aioplus.anextify¶
- aioplus.anextify(iterable, /, *, executor=None)¶
Make
iterableasynchronous.- Parameters:
iterable (Iterable[T]) – Iterable.
executor (ThreadPoolExecutor, optional) – Executor.
- Returns:
Iterator.
- Return type:
AsyncIterator[T]
Notes
If
executorisNone, then the default one is used (usually, a thread pool).
Examples
>>> iterable = [0, 1, 2, 3, 4, 5] >>> aiterable = anextify(iterable) >>> [num async for num in aiterable] [0, 1, 2, 3, 4, 5]
See also