Files
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

39 lines
1.5 KiB
TOML

[package]
name = "session-rs"
version = "0.2.1"
edition = "2024"
description = "A lightweight async request/response and notification protocol over WebSockets"
license = "Apache-2.0"
repository = "https://git.selimaj.dev/selimaj-dev/session-rs"
[features]
default = ["server", "client"]
# `SessionServer`: a standalone tokio-tungstenite WebSocket server.
server = ["dep:tokio-tungstenite", "tokio/net"]
# `Session::connect`: a tokio-tungstenite WebSocket client (ws:// only without a TLS feature).
client = ["dep:tokio-tungstenite", "tokio-tungstenite/connect"]
# `wss://` support for the client.
rustls = ["client", "tokio-tungstenite/rustls-tls-webpki-roots"]
native-tls = ["client", "tokio-tungstenite/native-tls"]
# `Session::from_axum`: run a session on an axum WebSocket upgrade.
axum = ["dep:axum"]
[dependencies]
futures-util = { version = "0.3.34", default-features = false, features = ["sink", "std"] }
serde = { version = "1.0.228", features = ["derive"] }
serde_json = "1.0.149"
tokio = { version = "1.49.0", features = ["macros", "rt", "sync", "time"] }
tokio-tungstenite = { version = "0.30.0", default-features = false, features = ["handshake"], optional = true }
axum = { version = "0.8.9", default-features = false, features = ["ws"], optional = true }
[dev-dependencies]
tokio = { version = "1.49.0", features = ["macros", "rt-multi-thread", "net", "time", "io-util"] }
axum = { version = "0.8.9", features = ["ws"] }
[[example]]
name = "axum"
required-features = ["axum"]
[package.metadata.docs.rs]
all-features = true