Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When queue is full, throw error instead of silently dropping messages #147

Open
Gjum opened this issue Jan 13, 2021 · 1 comment
Open

When queue is full, throw error instead of silently dropping messages #147

Gjum opened this issue Jan 13, 2021 · 1 comment

Comments

@Gjum
Copy link

Gjum commented Jan 13, 2021

Currently the send method silently drops messages when the _messageQueue exceeds maxEnqueuedMessages.

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.

@DanHarman
Copy link

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants