When commands are received for a client that is longpolling, then we need to buffer commands that arrive between when the message is sent to the longpoller, and when they reconnect. For example,
t=0, A connects via longpoll
t=100, message is received by A's long poller, and A's long poller disconnects
t=101, message is received by Incus for A, but is dropped because there is no client for A
t=102, A connects via longpoll
Instead, we need a threshold (preferably in time-units rather than absolute number of messages) buffer:
t=0, A connects via longpoll.
t=100, message is received by A's long poller, and A's long poller disconnects
t=101, message is received by Incus for A, and is placed into a buffer
t=102, A connects via longpoll, and a pending message is dispatched, and A's long poller disconnects.
t=104, A connects via longpoll.
When commands are received for a client that is longpolling, then we need to buffer commands that arrive between when the message is sent to the longpoller, and when they reconnect. For example,
Instead, we need a threshold (preferably in time-units rather than absolute number of messages) buffer: