Implements CallConnection in src/protocol/connection.rs representing an established alknet/call connection (either direction). Holds the Layer 2 imported-ops overlay (ADR-024) as Arc<RwLock<HashMap>>. - register_imported / register_imported_all add to the connection overlay - overlay_env returns an OperationEnv dispatching to imported ops; contains() returns true only for ops in the overlay - call() opens a stream, sends call.requested, registers in PendingRequestMap, spawns a stream reader, resolves on first call.responded - subscribe() sends call.requested and yields call.responded until call.completed/call.aborted via a SubscriptionStream wrapping the mpsc receiver - abort() sends call.aborted for the request ID and removes the pending entry - connection drop drops the overlay (no explicit deregistration needed) Exposes MockConnection trait and Connection::from_mock in alknet-core so cross-crate tests can construct mock connections without real QUIC. Removes two unused test helpers in env.rs that triggered dead-code warnings under -D warnings. Adds parking_lot dep for the overlay RwLock and pending Mutex. 9 new connection tests (102 total in alknet-call). Clippy clean.
26 lines
637 B
TOML
26 lines
637 B
TOML
[package]
|
|
name = "alknet-call"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
description = "Structured RPC over QUIC on ALPN `alknet/call`: operations, streaming subscriptions, service discovery"
|
|
repository.workspace = true
|
|
|
|
[lib]
|
|
name = "alknet_call"
|
|
|
|
[features]
|
|
default = []
|
|
|
|
[dependencies]
|
|
alknet-core = { path = "../alknet-core" }
|
|
irpc = { workspace = true }
|
|
tokio = { version = "1", features = ["full"] }
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = "1"
|
|
async-trait = "0.1"
|
|
tracing = "0.1"
|
|
thiserror = "2"
|
|
uuid = { version = "1", features = ["v4"] }
|
|
futures = "0.3"
|
|
parking_lot = "0.12" |