fix pooler so finisher is optional
This commit is contained in:
parent
3b31919f75
commit
9a3598b599
1 changed files with 2 additions and 1 deletions
|
@ -64,7 +64,8 @@ def make_pooler(pool_size, finisher=None):
|
||||||
desired_size = 0 if finish else pool_size - 1
|
desired_size = 0 if finish else pool_size - 1
|
||||||
while len(pending) > desired_size:
|
while len(pending) > desired_size:
|
||||||
done, pending = await wait(pending, return_when=FIRST_COMPLETED)
|
done, pending = await wait(pending, return_when=FIRST_COMPLETED)
|
||||||
finisher(done, pending)
|
if finisher is not None:
|
||||||
|
finisher(done, pending)
|
||||||
|
|
||||||
return pooler
|
return pooler
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue