1#![deny(rust_2018_idioms, warnings)]
3#![allow(clippy::type_complexity)]
4
5#[cfg(not(test))] pub use requiem_macros::{main, test};
7
8mod arbiter;
9mod builder;
10mod runtime;
11mod system;
12
13pub use self::arbiter::Arbiter;
14pub use self::builder::{Builder, SystemRunner};
15pub use self::runtime::Runtime;
16pub use self::system::System;
17
18#[doc(hidden)]
19pub use requiem_threadpool as blocking;
20
21pub fn spawn<F>(f: F)
27where
28 F: futures::Future<Output = ()> + 'static,
29{
30 if !System::is_set() {
31 panic!("System is not running");
32 }
33
34 Arbiter::spawn(f);
35}
36
37pub mod signal {
39 #[cfg(unix)]
40 pub mod unix {
41 pub use tokio::signal::unix::*;
42 }
43 pub use tokio::signal::ctrl_c;
44}
45
46pub mod net {
48 pub use tokio::net::UdpSocket;
49 pub use tokio::net::{TcpListener, TcpStream};
50
51 #[cfg(unix)]
52 mod unix {
53 pub use tokio::net::{UnixDatagram, UnixListener, UnixStream};
54 }
55
56 #[cfg(unix)]
57 pub use self::unix::*;
58}
59
60pub mod time {
62 pub use tokio::time::Instant;
63 pub use tokio::time::{delay_for, delay_until, Delay};
64 pub use tokio::time::{interval, interval_at, Interval};
65 pub use tokio::time::{timeout, Timeout};
66}