nchan icon indicating copy to clipboard operation
nchan copied to clipboard

Message delete without Redis

Open herenickname opened this issue 6 years ago • 4 comments

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?

herenickname avatar May 05 '19 15:05 herenickname

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.

slact avatar May 11 '19 02:05 slact

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.

neben avatar May 11 '19 08:05 neben

@slact maybe we can modify message data?

herenickname avatar May 11 '19 14:05 herenickname

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.

slact avatar May 11 '19 14:05 slact