feat(call): implement CallConnection with imported-ops overlay (Layer 2) and call/subscribe/abort methods
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.
This commit is contained in:
1
Cargo.lock
generated
1
Cargo.lock
generated
@@ -55,6 +55,7 @@ dependencies = [
|
||||
"async-trait",
|
||||
"futures",
|
||||
"irpc",
|
||||
"parking_lot",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"thiserror 2.0.18",
|
||||
|
||||
Reference in New Issue
Block a user