Skip to content

Commit c7486a5

Browse files
committed
feat: pipelining redis commands
1 parent 0c93605 commit c7486a5

File tree

15 files changed

+758
-931
lines changed

15 files changed

+758
-931
lines changed

.github/workflows/test.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: redis-x-stream
2+
on: push
3+
jobs:
4+
test:
5+
runs-on: ubuntu-latest
6+
strategy:
7+
matrix:
8+
node: [10, 12, 14, 15]
9+
services:
10+
redis:
11+
image: redis
12+
options: >-
13+
--health-cmd "redis-cli ping"
14+
--health-interval 10s
15+
--health-timeout 5s
16+
--health-retries 5
17+
ports:
18+
- 6379:6379
19+
name: redis-x-stream (Node ${{ matrix.node }})
20+
steps:
21+
- uses: actions/checkout@v2
22+
- uses: actions/setup-node@v2
23+
with:
24+
node-version: ${{ matrix.node }}
25+
- run: npm ci
26+
- run: npm run test:ci
27+
28+

README.md

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,22 @@
11
```
22
Work in progress 🚧👷‍♂️🔨
33
```
4+
# redis-x-stream
45

5-
# redis-x-iterable
6+
An [async iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/asyncIterator) that emits redis stream entries.
7+
Requires Redis 5 or greater.
68

7-
An Async Iterable Interface for redis streams.
9+
## Getting Started
810

911
```javascript
10-
import { RedisStream } from 'redis-x-iterable'
11-
12-
for await (const [id, keyVal] of new RedisStream('myStream')) {
12+
import { RedisStream } from 'redis-x-stream'
1313

14+
for await (const [stream, entry] of new RedisStream('myStream')) {
15+
//process an entry
1416
}
1517
```
16-
Additional options can utilize XREADGROUP
17-
```javascript
18-
19-
const stream = new RedisStream({
20-
keys: {
21-
'my-stream': ">"
22-
},
23-
group: 'mygroup',
24-
consumer: 'myconsumer',
25-
count: 100,
26-
blockMs: Infinity,
27-
28-
redis: redisClient,
29-
})
30-
```
18+
## TODO
19+
- [ ] xreadgroup
20+
- [ ] ack
21+
- [ ] del
22+
- [ ] eager load?

0 commit comments

Comments
 (0)