toloka.util.async_utils.AsyncGenAdapter
| Source code
AsyncGenAdapter(self, gen: AsyncGenerator[TypeVar('YieldType'), TypeVar('SendType')])
Adapter class that enables alternative syntax for iteration over async generator.
This class is used for backwards compatibility. Please use "async for" syntax in new code.
Examples:
main syntax
async for value in AsyncGenAdapter(async_gen): ...
alternative syntax (please do not use in new code):
for value in await AsyncGenAdapter(async_gen): ...
Method | Description |
---|---|
as_sync_gen | None |