Ingy wants to remove events from a dead client from message queue backlog.
While I don't think it's a good app design, being able to register a hook when a client disconnects sounds like a good idea for apps to extend the queue management.
More specifically, I(ngy) want to be able to selectively mark/remove msgs from the queue that have become invalid for some reason. It might be
(the first 2 are real needs :)
lestrrat bugged me about this as well on the other channel, and I finally grok the use case.
It's like in-app direct messaging, where each user is watching their "inbox" channel, like "inbox-$userid", and all DMs are sent to the listeners queue. The problem is that every time you reconnect to the queue (i.e. browser refresh) you'll see the old events you've already seen, for the length of backlogs.
You can set BacklogLength = 0 to avoid this, but then the messages sent while the user is offline will not be stored.
Of course you can avoid this by saving the direct messages to the database and display them in the connection and use the MQ only for realtime messaging, but i wonder hooks for client disconnect could be used for this thing as well..