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
//! The host runtime a shard's scheduler runs on.
//!
//! Grommet schedules work; it does not drive futures. Something has to own the
//! thread, poll the IO a processor performs, and decide how to wait when there
//! is nothing to do, and that something is an async runtime the caller already
//! uses. A `Driver` is the small surface grommet needs from one.
//!
//! The division is deliberate. A runtime knows how to wake a future when its
//! socket becomes readable; it does not know that two items sharing an affine
//! key must never run at once, or that compute belongs on a different core from
//! the reactor that dispatched it. Grommet supplies that and borrows the rest,
//! which is why adopting it does not mean leaving tokio.
//!
//! One driver is compiled in, chosen by a Cargo feature, and the shard loop is
//! the same across all of them. Each shard thread gets its own host instance,
//! placed on the CPU the topology plan chose for it.
//!
//! The trait is crate-private, so which runtime a build hosts on is expressed
//! by its features rather than by its public API.
use ;
use Duration;
compile_error!;
pub
/// The host a shard's reactor waits on.
pub
/// The host this build was compiled against.
pub type Host = TokioDriver;