blob: 09eda9594e0313146f48afef4e8e34c97a92b1fa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# Rivulet
Lightweight asynchronous data streams
```python
from rivulet import Pipeline, Batch
async def main():
pipe = Pipeline(source())
pipe.add_step(double)
batch = Batch(N=5, timeout=0.1)
pipe.add_step(batch)
pipe.add_step(sum)
# run the pipeline
async for out in pipe:
print(out)
# or collect them all
res = await pipe.collect()
```
|