Commit Graph
12 Commits
Author SHA1 Message Date
selimaj-devandclaude 05d5e53788 Release handlers on close to break session reference cycles
Handlers commonly capture a clone of their own Session, and the Session
owns its handlers, so a closed session was never freed. On shutdown,
take the on_close handler instead of cloning it and clear the request
and notification handlers after it runs.

Bump to 0.2.1.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-25 05:45:07 +02:00
selimaj-devandclaude d11d4ea08b Make the protocol transport-agnostic and use tokio-tungstenite
Replace the hand-rolled WebSocket implementation with a transport
boundary (Frame over any Sink/Stream) plus adapters for tokio-tungstenite
(server/client features) and axum (axum feature). The JSON wire format
is unchanged, so existing peers keep working.

Fixes:
- unbounded frame lengths were allocated up front; the server now
  enforces message/frame size limits (1 MiB default)
- responses arriving before `request` subscribed were lost
- an accept() error ended `session_loop`
- requests sent right after connecting could arrive before handlers
  were registered; the receiver now starts after `on_conn` returns
- panics in the receive loop skipped `on_close` and leaked sessions;
  `on_close` now runs exactly once and handler panics fail only their
  request
- unknown methods and invalid data got no reply; they now get an
  error response
- slow handlers blocked pongs and responses

Adds `on_notification`, `request_timeout`, `closed`, `is_closed`, `id`,
`ServerConfig`, `from_transport`, `from_tungstenite` and `from_axum`,
integration tests, and an axum example. Bumps to 0.2.0 since
`Session::connect` now takes a URL and the `ws` module is removed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-25 05:35:57 +02:00
selimaj-dev dd83ae219a Updated version 2026-03-30 13:41:09 +02:00
selimaj-dev a785141305 v0.1.2 2026-02-23 07:41:28 +01:00
selimaj-dev a26a6b75a0 Pinging 2026-02-23 05:28:19 +01:00
selimaj-dev 5bd9dac052 Ready for publish 2026-02-19 21:14:43 +01:00
selimaj-dev f7f1e97671 Simple session 2026-02-19 01:50:37 +01:00
selimaj-dev 09c1fbc232 async Read frame 2026-02-18 21:49:11 +01:00
selimaj-dev dd1d261353 Async session 2026-02-18 21:33:48 +01:00
selimaj-dev 3c254b75ff Async handshake 2026-02-18 21:24:00 +01:00
selimaj-dev d430d30ea2 Session 2026-02-18 21:16:13 +01:00
selimaj-dev e325ca02ce Simple structure 2026-02-18 20:51:35 +01:00