usage example; pool close instead of gather

This commit is contained in:
2022-02-04 19:23:09 +01:00
parent 7020493d53
commit f45fef6497
4 changed files with 83 additions and 62 deletions

View File

@ -71,7 +71,7 @@ class TaskPool:
def stop_all(self) -> int:
return self.stop(self.size)
async def gather(self, return_exceptions: bool = False):
async def close(self, return_exceptions: bool = False):
results = await gather(*self._tasks, *self._cancelled, return_exceptions=return_exceptions)
self._tasks = self._cancelled = []
return results