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

Handle client disconnection in message handler thread #259

Merged
merged 1 commit into from
Aug 14, 2023

Conversation

achim-k
Copy link
Collaborator

@achim-k achim-k commented Aug 11, 2023

Public-Facing Changes

Handle client disconnection in message handler thread

Description

This is a minor improvement that I noticed when working on #258. It may happen that the close handler is called before the last message of the client (e.g. unsubscribe) is handled which can lead to exceptions being raised when accessing the _clients map (as the client has been removed from that map already). By also handling close events in the message handler thread, we ensure that the close handler is always called last.

@achim-k achim-k requested a review from jtbandes August 11, 2023 14:27
@achim-k achim-k enabled auto-merge (squash) August 14, 2023 21:09
@achim-k achim-k merged commit 741187c into main Aug 14, 2023
10 checks passed
@achim-k achim-k deleted the achim/handle_close_in_message_handler branch August 14, 2023 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants