Closed andrewhampton closed 5 years ago
I've implemented it in the last commit to master (9acdc9ba32d251d667ff6c8de451415e95ee1ab7) with an explicit persist publish option.
The ruby client accepts a persist: true
to persist the channel and sequence in redis. Only when this is passed it will persist it. If another message on the same channel comes in without persist: true
it will set the expiry again, based on a given TTL or the default TTL. If you always want to persist a channel's messages, make sure to always pass persist: true
along.
If publishing a message without persist: true
adds back the TTL, then my concerns around the redis database growing forever are satisfied. It is simply up to the publisher to "delete" the channels it is done with by publishing an empty message that does not include persist: true
.
That said, I do feel that a TTL of 0
is more conventional than persist: true
: https://github.com/firehoseio/firehose/commit/9acdc9ba32d251d667ff6c8de451415e95ee1ab7#commitcomment-20285654
Firehose wasn’t designed to be a persistent data store. Persistent data should live on the application server and be served up via HTTP.
For data that should live a long time, a large ttl
could be passed into the publish payload to satisfy this use case.
@bakkdoor what do you think about a change like this to allow keys to persist indefinitely?