Skip to content

perf(websocket): streamline frame receive/send without Tokio future bridge (#257) - #264

Merged
ZhuchkaTriplesix merged 1 commit into
devfrom
issue-257-streamline-ws-futures
Oct 18, 2026
Merged

ZhuchkaTriplesix merged 1 commit into
devfrom
issue-257-streamline-ws-futures

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Closes #257

Summary of Changes

  • Streamline WebSocket frame receive/send methods in src/websocket.rs by returning native Python coroutines directly to the caller, completely removing the into_future -> future_into_py Tokio bridging layer per frame.
  • Add oxyroute/_ws.py internal asyncio coroutines (ws_accept, ws_receive, ws_receive_text, ws_receive_bytes, ws_send_text, ws_send_bytes, ws_send_json, ws_close_noop) cached via OnceLock in Rust.
  • Use Python's asyncio.Lock for frame send serialization instead of Tokio's cross-thread Mutex.
  • Update test_granian_e2e.py with brief polling for log file flush to prevent flaky race condition in test assertion on Windows.

@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit 7a7d25b into dev Oct 18, 2026
17 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.

1 participant