XREAD reads items sequentially from a stream. The structure of a stream guarantees that the XIDs are always increasing. This implies that calling XREAD in a loop and passing in the XID of the last item read will allow iteration over all items reliably. To start reading a stream from the beginning,
(key string, from XID, count int64)
| 619 | // |
| 620 | // Works similar to https://redis.io/commands/xread |
| 621 | func (c Client) XREAD(key string, from XID, count int64) (items []StreamItem, err error) { |
| 622 | return c.XRANGE(key, from.Next(), XEnd, count) |
| 623 | } |
| 624 | |
| 625 | type XReadOption string |
| 626 |