Treat multiple async iterators as a single async iterator.
Project description
Windmolen
Treat multiple asynchronous iterators like they are a single asynchronous iterator.
Example:
import asyncio
from windmolen import FanIn
async def async_iterator_1():
for i in range(1, 5):
yield i
await asyncio.sleep(0.5)
async def async_iterator_2():
for j in range(5, 9):
yield j
await asyncio.sleep(1)
async def main():
async with FanIn(async_iterator_1(), async_iterator_2()) as async_iterators:
async for item in async_iterators:
print(item)
if __name__ == "__main__":
asyncio.run(main())
Install
pip install windmolen
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
windmolen-0.0.1.tar.gz
(4.8 kB
view hashes)
Built Distribution
Close
Hashes for windmolen-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c07cf6b22e6e4d303c8c55143dbe92ecdfb416e8b2cc7e1fcd60bc58ff6c2d8 |
|
MD5 | f49d13dcdd91f97a4367641eb2c3d0a6 |
|
BLAKE2b-256 | 62e496df1a3605cd54af6edf74d5b350e7823c03cd3128465091f6a5e3d0e52a |