summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md17
1 files changed, 16 insertions, 1 deletions
diff --git a/README.md b/README.md
index c268928..33b51b2 100644
--- a/README.md
+++ b/README.md
@@ -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