Handling delayed messages in queues.
Currently the management of delayed messages is not scalable. Messages are not kept in the queue (memory) and a task is scheduled for each (the message is kept in this task and sent with the publication notification).
This way of handling timed messages is not scalable. We should maintain an ordered list of timed messages, and set a timer for the first timeout (see Scheduler class).