Skip to main content

watch

Function watch 

Source
async fn watch<H, HF, D, DF>(
    block_id: &str,
    holding: H,
    deliver: D,
    fast: Duration,
    slow: Duration,
    fast_for: Duration,
)
where H: Fn() -> HF, HF: Future<Output = bool>, D: Fn(String, MessageOrigin) -> DF, DF: Future<Output = Result<(), String>>,
Expand description

The watcher: looks every fast for fast_for, then every slow, and when holding says the agent can work, sends what is kept through deliver and answers each sender still waiting. Ends when nothing is kept for block_id.