cl-gserver icon indicating copy to clipboard operation
cl-gserver copied to clipboard

Discard message queue items that have timed out

Open mdbergmann opened this issue 7 months ago • 0 comments

Sending messages to an actor with timeout will be processed even if the caller receives a 'ask-timeout' condition.

I think it should be possible to include a universal timestamp to the queue item for when the item is obsolete. When it is obsolete, processing it can be discarded.

Care must be taken to not discard a queue item that has not timed out yet. So we should give it a few seconds more.

IDEA: we could spare the wheel-timer if we would raise the ask-timeout condition only in the above case and at the queue level. The caveat would be that when an actor is 'asked' with a timeout of say 20 seconds, but the queue item is handled after 30 seconds, then the user would get the timeout just then, but not at 20 seconds as he specified.

Yet, checking at the time of processing the message would be fine still.

mdbergmann avatar Jan 16 '24 20:01 mdbergmann