[][src]Module ratman::clock

Enables router internal clock manipulation

By default, each detached task inside Ratman is run at the speed that the hardware allows, i.e. polling tasks will not wait between poll loops. This is usually fine, on systems that are not battery or CPU constrained. However, on systems that are, it can cause huge battery drain. This is where Clockwork comes in, a clock receiver which can be configured with various types to manipulate the runtime behaviour of the internal tasks running inside Ratman.

# use ratman::{clock::*, Router};
let r = Router::new();
let mut clw = Clockwork::new();
clw.clock(Target::Journal)
    .interval(Interval::Timed(Duration::from_secs(10));

clw.clock(Target::SwitchRecv);
    .interval(Interval::Stepped)
    .fence(move |_| {
        // ...
    });

r.clock(clw);

Structs

Clock

Represents a single clock target inside the Clockwork collection

Clockwork

A collection of clocking instructions for Ratman

Enums

Error

An Error type for various clock related failures

Interval

The type of clocking mechanism to use

Target

A set of internal components that can be externally clocked