Skip to main content

used_within

Function used_within 

Source
pub fn used_within(window: Duration) -> bool
Expand description

Whether this process was used over HTTP within the last window: a request answered in it, or a live channel open now. The idle timer asks this beside the MCP sessions.

use std::time::Duration;
use majordomus_cli::http::server::used_within;
// a process that has answered nothing over HTTP and holds no channel has not been used
assert!(!used_within(Duration::from_secs(60)));