Skip to main content

AsyncPeerProbe

Type Alias AsyncPeerProbe 

Source
pub type AsyncPeerProbe = Arc<dyn Fn(PeerId, BroadcastRequest) -> Pin<Box<dyn Future<Output = Result<Vec<HitWithScore>, String>> + Send + 'static>> + Send + Sync + 'static>;
Expand description

Async per-peer probe callback.

Production wiring builds this on top of the dnode peer channel (encode the BroadcastRequest, send the resulting crate::proto::dnode::DmsgType::FtSearchReq frame, await the matching crate::proto::dnode::DmsgType::FtSearchRep, decode and return the hits). Tests pass an in-memory callback that simulates per-peer behaviour without standing up real connections.

Aliased Typeยง

pub struct AsyncPeerProbe { /* private fields */ }