usage example; pool close instead of gather

This commit is contained in:
daniil-berg committed 2022-02-04 19:23:09 +01:00
1 parent 7020493d53
commit f45fef6497
4 files changed
+83 -62

No files matched your search

+1 -1
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