Skip to content

Document WebSocket callback threads and shutdown ownership - #638

Merged
bsergean merged 1 commit into
masterfrom
docs/threading-model
Nov 10, 2026
Merged

bsergean merged 1 commit into
masterfrom
docs/threading-model

Conversation

@bsergean

Copy link
Copy Markdown
Collaborator

Applications need to know which thread can invoke a WebSocket callback to avoid reentrant locking and shutdown deadlocks. Document callback execution for clients using start(), explicit connect()/run(), and server connections, along with the separate contexts for send progress and the shared traffic tracker.

Explain that fatal send failures now defer Close delivery to the connection thread, following #635. Add lifecycle guidance: configure callbacks before processing starts, use close() inside handlers, perform stop() and destruction from an owning thread, and avoid holding application locks needed by callbacks while joining.

Closes #457. The send-failure behavior was fixed by #635; this change documents the threading model and remaining usage constraints.

Validation: mkdocs build --strict and git diff --check passed. The investigation also rebuilt master and ran IXWebSocketSendFailureTest: 60 assertions in 4 test cases passed. Documentation only; no runtime changes.

@bsergean
bsergean merged commit 7d74804 into master Nov 10, 2026
13 checks passed
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

Successfully merging this pull request may close these issues.

Threading concerns

1 participant