Message delete without Redis
Q1: It is possible to delete a message by its id from a channel, without removing a channel? I'm not using Redis, all messages stored in memory.
Want something like that: DELETE /pub/123 -> remove the message with id 123
Q2: it's possible to announce all subscribers of the channel that message deleted?
Q1: It is possible to delete a message by its id from a channel, without removing a channel?
No.
Q2: it's possible to announce all subscribers of the channel that message deleted?
No.
Per-message channel buffer modification may be available in a future version, but I'm not sold on it being a common enough use case.
Per-message channel buffer modification may be available in a future version, but I'm not sold on it being a common enough use case.
Here's a use case: We use nchan to notify online and offline subscribers about file updates. Offline subscribers must not miss these updates, when they come online again, messages are therefore buffered (currently n=1000). But if a resource changes frequently, a client will have to download a lot of out-of-date messages from nchan, potentially even evicting an unfrequent event from the buffer. It would therefore be great to delete the old (repeated) message. Alternatively, instead of selectively deleting messages, we'd be fine with a unique option for a channel, that would just replace a message in the buffer with the new item, if the content is the same. Actually, we'd like that even more :)
That's just my +1 for this feature, i can go into more detail if that would help.
@slact maybe we can modify message data?
Editing the message buffer is currently not possible, apart from trimming off the end. This isn't going to change in Nchan version 1.x.
I am, however working on taking Nchan off of nginx in version 2, which also givea me more flexibility to add message editing features. Do let me know if that is something you are interested in sponsoring. I can see some pretty common use cases and wouldn't be absent to adding this in -- Nchan is all about flexibility after all.