1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//! 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.
//!
//! ```norun
//! # 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);
pub use ;
pub use Error;
use Duration;
/// The type of clocking mechanism to use
/// A set of internal components that can be externally clocked
///
/// Each component can be controlled individually, while the
/// [`Clockwork`] data object also allows for global settings to apply
/// for all scheduled tasks.
///
/// [`Clockwork`]: struct.Clockwork.html