14 Commits

Author SHA1 Message Date
antirez
541b1a7cc3 Streams: fix XADD API and keyspace notifications.
XADD was suboptimal in the first incarnation of the command, not being
able to accept an ID (very useufl for replication), nor options for
having capped streams.

The keyspace notification for streams was not implemented.
2017-12-01 10:24:24 +01:00
antirez
433624adda Streams: When XREAD blocks without COUNT, set a default one.
A client may lose a lot of time between invocations of blocking XREAD,
for example because it is processing the messages or for any other
cause. When it returns back, it may provide a low enough message ID that
the server will block to send an unreasonable number of messages in a
single call. For this reason we set a COUNT when the client is blocked
with XREAD calls, even if no COUNT is given. This is arbitrarily set to
1000 because it's enough to avoid slowing down the reception of many
messages, but low enough to avoid to block.
2017-12-01 10:24:24 +01:00
antirez
799eaab940 Streams: fix XREAD ready-key signaling.
With lists we need to signal only on key creation, but streams can
provide data to clients listening at every new item added.
To make this slightly more efficient we now track different classes of
blocked clients to avoid signaling keys when there is nobody listening.
A typical case is when the stream is used as a time series DB and
accessed only by range with XRANGE.
2017-12-01 10:24:24 +01:00
antirez
671c1a2251 Streams: fix XREAD timeout handling, zero is valid. 2017-12-01 10:24:24 +01:00
antirez
9290ad3cb9 Streams: XREAD ability to block fixed. 2017-12-01 10:24:24 +01:00
antirez
539d8747b2 Streams: synchronous xread fixes and improvements. 2017-12-01 10:24:24 +01:00
antirez
004a8b8712 Streams: XREAD, first draft. Handling of blocked clients still missing. 2017-12-01 10:24:24 +01:00
antirez
7ccc80d503 Streams: XREAD arguments parsing. 2017-12-01 10:24:24 +01:00
antirez
a477b95b01 Streams: augment client.bpop with XREAD specific fields. 2017-12-01 10:24:24 +01:00
antirez
8016093ee9 Streams: implement stream object release. 2017-12-01 10:24:24 +01:00
antirez
6a4fd95478 Streams: XLEN command. 2017-12-01 10:24:24 +01:00
antirez
fac980c6d1 Streams: RDB saving. 2017-12-01 10:24:24 +01:00
antirez
27fd469a8d Streams: assign value of 6 to OBJ_STREAM + some refactoring. 2017-12-01 10:24:24 +01:00
antirez
1850ff43f4 Streams: 12 commits squashed into the initial Streams implementation. 2017-12-01 10:24:24 +01:00