Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🏞️ Implement streams commands #86

Merged
merged 154 commits into from
Jul 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
154 commits
Select commit Hold shift + click to select a range
2c82632
Implement xadd and xread
Terkwood Jun 7, 2020
3e55b82
Implement xdel
Terkwood Jun 8, 2020
c5b6805
Implement xlen
Terkwood Jun 8, 2020
993f81e
Rewrite xaddMaxlen
Terkwood Jun 8, 2020
c70de2b
Rework arg
Terkwood Jun 8, 2020
3b65989
Use snake case for consistency
Terkwood Jun 8, 2020
2e0bcb6
Update test
Terkwood Jun 8, 2020
55bf5d5
Add TODO
Terkwood Jun 8, 2020
6410b22
Add test
Terkwood Jun 8, 2020
90d59fc
Trim
Terkwood Jun 12, 2020
733f651
Merge branch 'master' into feat-streams
Terkwood Jun 12, 2020
d2979d9
Add method sig
Terkwood Jun 13, 2020
3dd3647
Draft XREADGROUP impl
Terkwood Jun 13, 2020
43166c5
STUB TEST
Terkwood Jun 13, 2020
f8b1758
add test
Terkwood Jun 14, 2020
3e64b6b
stub out method
Terkwood Jun 14, 2020
43c4176
fix sig
Terkwood Jun 14, 2020
436913c
Add impls
Terkwood Jun 14, 2020
9a73e34
Add docs
Terkwood Jun 14, 2020
9962324
Add docs and impl
Terkwood Jun 14, 2020
5dae056
Assert
Terkwood Jun 14, 2020
9572768
Assert
Terkwood Jun 14, 2020
5145e15
stub test
Terkwood Jun 14, 2020
00af089
add tests
Terkwood Jun 14, 2020
b7d6180
Update interface
Terkwood Jun 14, 2020
d7d3f87
Update test
Terkwood Jun 14, 2020
2d3630c
Add xack and xreadgroup auto ack
Terkwood Jun 14, 2020
9d6082a
Stub tests
Terkwood Jun 14, 2020
3c52530
Update doc
Terkwood Jun 14, 2020
377baf1
Rename and trim
Terkwood Jun 14, 2020
56e98ba
Rename consts
Terkwood Jun 15, 2020
8480115
Add test
Terkwood Jun 15, 2020
7e503bc
Add test
Terkwood Jun 15, 2020
afb7cb6
Stub out test
Terkwood Jun 15, 2020
b0e2770
clean up helper
Terkwood Jun 16, 2020
507e2ce
flesh out test
Terkwood Jun 16, 2020
02b2aa5
add doc
Terkwood Jun 16, 2020
9e0c797
trim useless acks
Terkwood Jun 16, 2020
901dfc7
Correct test
Terkwood Jun 16, 2020
5e36442
Assert
Terkwood Jun 17, 2020
aa6b8eb
Add test
Terkwood Jun 17, 2020
68fec20
Fix tests
Terkwood Jun 17, 2020
e600f3f
Stub out xrange
Terkwood Jun 17, 2020
1cc62c9
Impl xranges and add tests
Terkwood Jun 17, 2020
f6158cf
Trim logs
Terkwood Jun 17, 2020
e4d3f9f
Trim logs
Terkwood Jun 17, 2020
b403b68
Fix test
Terkwood Jun 17, 2020
94cea6c
Implement XTRIM, flip logic
Terkwood Jun 17, 2020
1c148d5
Implementing some test cleanup
Terkwood Jun 17, 2020
f40c2b7
use less common key name in test
Terkwood Jun 17, 2020
7242e3e
Rename and dedupe
Terkwood Jun 17, 2020
16891de
Rename, dedupe, clean up
Terkwood Jun 17, 2020
b36364a
Use random key, cleanup
Terkwood Jun 17, 2020
8299df6
Move functions to test
Terkwood Jun 17, 2020
c23a34e
trim useless stuff
Terkwood Jun 17, 2020
5ef05aa
cleanup
Terkwood Jun 17, 2020
f760589
move fn
Terkwood Jun 17, 2020
71f0928
Cleanup and rename
Terkwood Jun 17, 2020
03293dd
simplify test
Terkwood Jun 17, 2020
d1e05df
rename and cleanup
Terkwood Jun 17, 2020
6a55241
Create interface and stub method
Terkwood Jun 19, 2020
009d808
Update doc
Terkwood Jun 19, 2020
41fd59d
Update doc comment
Terkwood Jun 19, 2020
0ccef8f
Rename arg
Terkwood Jun 20, 2020
d86dac0
Add doc
Terkwood Jun 20, 2020
4516d31
stub out test
Terkwood Jun 20, 2020
edb710f
Merge remote-tracking branch 'upstream/master' into feat-streams
Terkwood Jun 20, 2020
b0642bb
create test
Terkwood Jun 21, 2020
28fc416
Improve test
Terkwood Jun 21, 2020
e62b64e
Test with xadd
Terkwood Jun 21, 2020
2bdc3c8
Merge remote-tracking branch 'upstream/master' into feat-streams
Terkwood Jun 22, 2020
efefa54
Sketch out test idea
Terkwood Jun 22, 2020
c3e4599
Flail mildly
Terkwood Jun 22, 2020
d9a42ee
Merge remote-tracking branch 'upstream/master' into feat-streams
Terkwood Jun 22, 2020
59e8f56
Stub out xpending
Terkwood Jun 22, 2020
8f06288
Write interface
Terkwood Jun 22, 2020
b6f8962
Shuffle file
Terkwood Jun 22, 2020
1b586bb
Advance XPENDING impl
Terkwood Jun 23, 2020
1b1654a
Rename const
Terkwood Jun 23, 2020
c687aec
Merge remote-tracking branch 'upstream/master' into feat-streams
Terkwood Jun 23, 2020
bbf2454
Clarify logic
Terkwood Jun 24, 2020
d66f7a5
Advance test
Terkwood Jun 24, 2020
9227582
Assert
Terkwood Jun 24, 2020
7fa36da
Consider a data structure for XMessage
Terkwood Jun 24, 2020
ebf807f
trim
Terkwood Jun 24, 2020
870537d
Rework return type
Terkwood Jun 26, 2020
00a75f3
Deal with return type in test
Terkwood Jun 26, 2020
f0f4c14
Flail
Terkwood Jun 26, 2020
61bc789
Fix return types and tests
Terkwood Jun 26, 2020
c47883c
Fix test
Terkwood Jun 26, 2020
35aac9b
Fix test
Terkwood Jun 26, 2020
aed1167
Improve API type safety for XREAD(GROUP)
Terkwood Jun 26, 2020
aeaf232
Update doc
Terkwood Jun 26, 2020
104b8e1
Rework API
Terkwood Jun 27, 2020
9ca03bb
Confused on Map behavior
Terkwood Jun 27, 2020
f763052
Deal with Record and Map in XADD
Terkwood Jun 27, 2020
b7cadff
Trim console.log
Terkwood Jun 27, 2020
341b27d
Nitpick
Terkwood Jun 28, 2020
86b2598
Merge remote-tracking branch 'upstream/master' into feat-streams
Terkwood Jun 28, 2020
f1e45ad
Try XId again
Terkwood Jun 28, 2020
c8025c0
Convert to string
Terkwood Jun 28, 2020
0de4a46
Mangle XIds
Terkwood Jun 28, 2020
6ee8f84
Fix tests and interface
Terkwood Jun 28, 2020
427df2c
Fix test expectations
Terkwood Jun 28, 2020
8109a39
Set docs
Terkwood Jun 28, 2020
8ae8130
Add XRANGE doc
Terkwood Jun 28, 2020
1fc9704
Tidy up doc
Terkwood Jun 28, 2020
d3a252e
Add doc
Terkwood Jun 28, 2020
e17597b
Add doc
Terkwood Jun 28, 2020
a9ded27
Rename values
Terkwood Jun 28, 2020
f8489c0
Stub out methods
Terkwood Jun 28, 2020
1b96f3c
Rename val and impl partial method
Terkwood Jun 28, 2020
0890794
Set docs
Terkwood Jun 28, 2020
09c7f56
Relax type constraint
Terkwood Jun 28, 2020
8c7aa00
Implement part of xpending, fix test
Terkwood Jun 29, 2020
1c09212
Trim and add doc
Terkwood Jun 29, 2020
42fb089
Pass lint
Terkwood Jun 29, 2020
c8495e6
Make mod and trim
Terkwood Jun 29, 2020
ed90846
Dont just remove things
Terkwood Jun 29, 2020
1d7ae64
Stub out tests
Terkwood Jun 29, 2020
b3d1c5b
Add test and fix comparison
Terkwood Jun 29, 2020
bb1e591
Fix xpending case
Terkwood Jun 29, 2020
71992ca
Trim console.log
Terkwood Jun 29, 2020
7a4df39
Parse XCLAIM response and assert in test
Terkwood Jun 29, 2020
8e720ee
Update README
Terkwood Jun 29, 2020
94b97c0
Improve tests and rename field
Terkwood Jun 29, 2020
43c1254
Split method...
Terkwood Jun 29, 2020
4d4bd7d
Fix doc
Terkwood Jun 29, 2020
62a934c
Rename methods
Terkwood Jun 29, 2020
3c4db6e
Advance XINFO
Terkwood Jun 29, 2020
68b8c29
Rename epochMs -> unixMs, expand method
Terkwood Jun 29, 2020
7bd7099
Use bigint for redis u64
Terkwood Jun 29, 2020
cb6b8ee
Implement method
Terkwood Jun 29, 2020
32f8b1b
Make assertions
Terkwood Jun 29, 2020
820e951
Fiddle with XREADGROUP type
Terkwood Jun 29, 2020
1ccd5c8
Fiddle with XREAD type
Terkwood Jun 29, 2020
18c9d76
Deal with key/id args correctly
Terkwood Jun 29, 2020
0f35c0e
Implement XINFO STREAMS FULL
Terkwood Jun 29, 2020
4a499d4
Remove bigint
Terkwood Jun 30, 2020
15b3a26
Add test
Terkwood Jun 30, 2020
944c088
Implement methods
Terkwood Jun 30, 2020
e122375
Expand test
Terkwood Jun 30, 2020
eacc608
Expand test
Terkwood Jun 30, 2020
e1aef2d
Finish test
Terkwood Jun 30, 2020
cc7738f
Match doc params to method sigs
Terkwood Jun 30, 2020
1eebbc3
Merge remote-tracking branch 'upstream/master' into feat-streams
Terkwood Jun 30, 2020
4cd274b
Fix scoping of cleanupStream
Terkwood Jul 2, 2020
16b736b
Simplify test assertions
Terkwood Jul 2, 2020
c71a318
Update command.ts
Terkwood Jul 2, 2020
c2c3738
Use delay in test
Terkwood Jul 2, 2020
7e08289
Convert to assertThrowsAsync...
Terkwood Jul 2, 2020
024ddc9
Trim log statement
Terkwood Jul 2, 2020
0e6a2fd
Fix text
Terkwood Jul 2, 2020
32820a3
Fix test assertion
Terkwood Jul 2, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,26 @@ const sub = await redis.subscribe("channel");
})();
```

**Streams**

```ts
await redis.xadd(
"somestream",
"*", // let redis assign message ID
{ yes: "please", no: "thankyou" },
{ elements: 10 },
);

const [stream] = await client.xread(
[{ key: "somestream", xid: 0 }], // read from beginning
{ block: 5000 },
);

const msgFV = stream.messages[0].field_values;
const plz = msgFV.get("yes");
const thx = msgFV.get("no");
```

## Advanced Usage

### Retriable connection
Expand Down
Loading