(self)
| 353 | self.step(future.result()) |
| 354 | |
| 355 | def close(self): |
| 356 | if self.task_closed: |
| 357 | return |
| 358 | |
| 359 | self.task_closed = True |
| 360 | |
| 361 | self.coro.close() |
| 362 | while self.pending_futures: |
| 363 | _, f = self.pending_futures.popitem() |
| 364 | f.cancel() |
| 365 | |
| 366 | self.on_coro_stop(self) |
| 367 | self.on_coro_stop = None # avoid circular reference |
| 368 | self.session = None |
| 369 | |
| 370 | logger.debug('Task[%s] closed', self.coro_id) |
| 371 | |
| 372 | def __del__(self): |
| 373 | if not self.task_closed: |