Skip to content

Commit

Permalink
add description, example, and install info
Browse files Browse the repository at this point in the history
  • Loading branch information
aaraney committed Jun 14, 2023
1 parent 6ec25ee commit 19defe6
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Windmolen

Treat multiple asynchronous iterators like they are a single asynchronous iterator.

**Example:**

```python
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

```shell
pip install windmolen
```

0 comments on commit 19defe6

Please sign in to comment.