MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / register_and_complete

Function register_and_complete

nodedb/src/control/request_tracker.rs:140–150  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

138
139 #[tokio::test]
140 async fn register_and_complete() {
141 let tracker = RequestTracker::new();
142 let mut rx = tracker.register(RequestId::new(1));
143 assert_eq!(tracker.in_flight(), 1);
144
145 assert!(tracker.complete(make_response(1)));
146 assert_eq!(tracker.in_flight(), 0);
147
148 let resp = rx.recv().await.unwrap();
149 assert_eq!(resp.request_id, RequestId::new(1));
150 }
151
152 #[test]
153 fn complete_unknown_returns_false() {

Callers

nothing calls this directly

Calls 2

registerMethod · 0.45
recvMethod · 0.45

Tested by

no test coverage detected