It would be handy if the batch() function could take AsyncGeneratorType.
return await gather(
*Threads().batch(
Call(
my_func,
kind=item,
) async for item in my_async_gen
)
)
The current workaround is this:
with Threads() as pool:
futs = [
pool.call(
my_func,
kind=item,
) async for item in my_async_gen
]
return await gather(*(f for f in futs))