summaryrefslogtreecommitdiff
path: root/README.md
blob: 971861896ec32540ad15777ba2d7d5aedd19d966 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Rivulet

Lightweight asynchronous data streams.

## Installation

Package is not currently published, use directly from source:

```bash
$ uv add git+https://github.com/yuvadm/rivulet.git
```

## Usage

```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()
```