Skip to content

Commit 3405b4c

Browse files
committed
docs: readme
1 parent b04e45f commit 3405b4c

1 file changed

Lines changed: 4 additions & 15 deletions

File tree

readme.md

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,14 @@ BTW: The wrapped function returns tuples `(idx, res)` consisting of the data ind
3737

3838
### Quick Start
3939

40-
> 10 workers, each with a maximum qps of 10, to sample data from input stream (i.e. reservoir sampling)
40+
> 10 workers, each with a maximum qps of 10, to say "hello world"
4141
4242
```python
43-
import random
44-
4543
from qps_limit import Limiter
4644

4745

4846
async def func(n: int):
49-
return n
47+
return "hello world {}".format(n)
5048

5149

5250
def params():
@@ -62,17 +60,8 @@ f = Limiter(
6260
ordered=False
6361
)
6462

65-
i = 0
66-
k = 10
67-
d = []
68-
for _, res in f():
69-
if i < k:
70-
d.append(res)
71-
else:
72-
j = random.randint(0, i)
73-
if j < k:
74-
d[j] = res
75-
i += 1
63+
for idx, res in f():
64+
print(idx, res)
7665
```
7766

7867
```

0 commit comments

Comments
 (0)