Skip to main content

decide_within

Function decide_within 

Source
pub async fn decide_within<P: PeerId>(
    policy: &dyn DynPolicy<P>,
    request: &PeerRequest<P>,
    timeout: Duration,
) -> Decision
Expand description

Asks policy about request within timeout, as a node does before it admits a session.

A policy that takes longer is a rejection with moq_net::Error::Timeout.

Needs a tokio runtime with time enabled. Dropping the future drops the policy’s.