Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] Memory usage: CAP the stream (#6)
* [FIX] Memory usage CAO the stream Make sure we keep our stream in check using the maxlen option. According to the documentation # Documentation https://redis.io/docs/latest/commands/xadd/ ## Capped streams XADD incorporates the same semantics as the XTRIM command - refer to its documentation page for more information. This allows adding new entries and keeping the stream's size in check with a single call to XADD, effectively capping the stream with an arbitrary threshold. Although exact trimming is possible and is the default, due to the internal representation of steams it is more efficient to add an entry and trim stream with XADD using almost exact trimming (the ~ argument). For example, calling XADD in the following form: ``` XADD mystream MAXLEN ~ 1000 * ... entry fields here ... ``` Will add a new entry but will also evict old entries so that the stream will contain only 1000 entries, or at most a few tens more. * formatting