We should store all the events to be sent to a client in a queue, and empty the queue when we have a response object available.
We need to use a queue because if we immediately try to sent the events, it is possible that the client has not sent another polling request at the time of sending events, leading to the events being sent nowhere, and never reaching the client.
Description
We should store all the events to be sent to a client in a queue, and empty the queue when we have a response object available. We need to use a queue because if we immediately try to sent the events, it is possible that the client has not sent another polling request at the time of sending events, leading to the events being sent nowhere, and never reaching the client.
Notes