summaryrefslogtreecommitdiffstats
path: root/tokio/src/runtime/current_thread/builder.rs
diff options
context:
space:
mode:
authorCarl Lerche <me@carllerche.com>2019-06-24 12:34:30 -0700
committerGitHub <noreply@github.com>2019-06-24 12:34:30 -0700
commit06c473e62842d257ed275497ce906710ea3f8e19 (patch)
tree4ca6d337a892aa23266a761b35dc61e988e57954 /tokio/src/runtime/current_thread/builder.rs
parentaa99950b9c983b842bd2107bb771c277d09d495d (diff)
Update Tokio to use `std::future`. (#1120)
A first pass at updating Tokio to use `std::future`. Implementations of `Future` from the futures crate are updated to implement `Future` from std. Implementations of `Stream` are moved to a feature flag. This commits disables a number of crates that have not yet been updated.
Diffstat (limited to 'tokio/src/runtime/current_thread/builder.rs')
-rw-r--r--tokio/src/runtime/current_thread/builder.rs24
1 files changed, 13 insertions, 11 deletions
diff --git a/tokio/src/runtime/current_thread/builder.rs b/tokio/src/runtime/current_thread/builder.rs
index dbc19fc1..d7e5323c 100644
--- a/tokio/src/runtime/current_thread/builder.rs
+++ b/tokio/src/runtime/current_thread/builder.rs
@@ -1,8 +1,8 @@
-use crate::executor::current_thread::CurrentThread;
use crate::runtime::current_thread::Runtime;
+use tokio_current_thread::CurrentThread;
use tokio_reactor::Reactor;
-use tokio_timer::clock::Clock;
-use tokio_timer::timer::Timer;
+//use tokio_timer::clock::Clock;
+//use tokio_timer::timer::Timer;
use std::io;
/// Builds a Single-threaded runtime with custom configuration values.
@@ -35,8 +35,8 @@ use std::io;
/// ```
#[derive(Debug)]
pub struct Builder {
- /// The clock to use
- clock: Clock,
+ // /// The clock to use
+ //clock: Clock,
}
impl Builder {
@@ -46,15 +46,17 @@ impl Builder {
/// Configuration methods can be chained on the return value.
pub fn new() -> Builder {
Builder {
- clock: Clock::new(),
+ //clock: Clock::new(),
}
}
+ /*
/// Set the `Clock` instance that will be used by the runtime.
pub fn clock(&mut self, clock: Clock) -> &mut Self {
self.clock = clock;
self
}
+ */
/// Create the configured `Runtime`.
pub fn build(&mut self) -> io::Result<Runtime> {
@@ -64,18 +66,18 @@ impl Builder {
// Place a timer wheel on top of the reactor. If there are no timeouts to fire, it'll let the
// reactor pick up some new external events.
- let timer = Timer::new_with_now(reactor, self.clock.clone());
- let timer_handle = timer.handle();
+ //let timer = Timer::new_with_now(reactor, self.clock.clone());
+ //let timer_handle = timer.handle();
// And now put a single-threaded executor on top of the timer. When there are no futures ready
// to do something, it'll let the timer or the reactor to generate some new stimuli for the
// futures to continue in their life.
- let executor = CurrentThread::new_with_park(timer);
+ let executor = CurrentThread::new_with_park(reactor /*timer*/);
let runtime = Runtime::new2(
reactor_handle,
- timer_handle,
- self.clock.clone(),
+ //timer_handle,
+ //self.clock.clone(),
executor);
Ok(runtime)