Open Gjum opened 3 years ago
Yes it should have the standard websocket semantics of throwing connection not open when the queue is full. This would actually be useful since not all scenarios want to buffer sends over reconnects (e.g. pub sub requests, I hit a problem where the unsubscribe was buffered and sent on a new session which then caused problems with the ack message unsubscribing the new sub as the id counter reset).
Currently the
send
method silently drops messages when the_messageQueue
exceedsmaxEnqueuedMessages
.Since this library is about automatically reconnecting and resending messages, the
send
method contract implies that messages aren't dropped while the client is disconnected.As this method contract cannot be met when the queue is full, an exception should be thrown to signal this to the caller.