diff options
| author | Yuval Adam <_@yuv.al> | 2025-03-20 13:36:24 +0100 |
|---|---|---|
| committer | Yuval Adam <_@yuv.al> | 2025-03-20 13:38:06 +0100 |
| commit | 1f1d235a69c84e06eacc69b9a6041b79ddc51c2d (patch) | |
| tree | ebc45ba5e77fefcfd1bbdb0340d2dc095bf02ca9 | |
| parent | 313310fe9fe4bf79f78ad6e0b8e6361023c419a7 (diff) | |
Add basic README
| -rw-r--r-- | README.md | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -1,3 +1,18 @@ # Rivulet -Elegant asynchronous data streams
\ No newline at end of file +Elegant asynchronous data streams + +```python +from rivulet import BatchProcessor + +async def item_stream(): + for i in range(10): + yield i + await asyncio.sleep(0.1) + +async def main(): + processor = BatchProcessor(batch_size=3, timeout_seconds=0.5) + + async for batch in processor.process(item_stream()): + print(f"Processing batch of {len(batch)} items: {batch}") +```
\ No newline at end of file |
