diff options
| author | Zeyla Hellyer <[email protected]> | 2017-09-21 17:00:41 -0700 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2017-09-21 17:00:41 -0700 |
| commit | e6a503409e374277683f76142eace62264ca533d (patch) | |
| tree | fff8e976ead3be463d0e3817a3a4bbc3b7b439d3 /src/client/mod.rs | |
| parent | Fix a documentation typo (diff) | |
| download | serenity-e6a503409e374277683f76142eace62264ca533d.tar.xz serenity-e6a503409e374277683f76142eace62264ca533d.zip | |
Remove tokio usage
Diffstat (limited to 'src/client/mod.rs')
| -rw-r--r-- | src/client/mod.rs | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/src/client/mod.rs b/src/client/mod.rs index 5eec673..20c2bd6 100644 --- a/src/client/mod.rs +++ b/src/client/mod.rs @@ -39,8 +39,6 @@ use self::dispatch::dispatch; use std::sync::{self, Arc}; use std::sync::atomic::{AtomicBool, Ordering, ATOMIC_BOOL_INIT}; use parking_lot::Mutex; -use tokio_core::reactor::Core; -use futures; use std::collections::HashMap; use std::time::Duration; use std::{mem, thread}; @@ -798,13 +796,7 @@ impl<H: EventHandler + Send + Sync + 'static> Client<H> { }}; threads.push(thread::spawn(move || { - let mut core = Core::new().unwrap(); - - core.run(futures::future::lazy(move || { - monitor_shard(monitor_info); - - futures::future::ok::<(), ()>(()) - })).unwrap(); + monitor_shard(monitor_info); })); }, Err(why) => warn!("Error starting shard {:?}: {:?}", shard_info, why), @@ -954,8 +946,6 @@ fn monitor_shard<H: EventHandler + Send + Sync + 'static>(mut info: MonitorInfo< } fn handle_shard<H: EventHandler + Send + Sync + 'static>(info: &mut MonitorInfo<H>) { - let mut core = Core::new().unwrap(); - let handle = core.handle(); // This is currently all ducktape. Redo this. while HANDLE_STILL.load(Ordering::Relaxed) { @@ -1029,17 +1019,13 @@ fn handle_shard<H: EventHandler + Send + Sync + 'static>(info: &mut MonitorInfo< &info.shard, &info.framework, &info.data, - &info.event_handler, - &handle); + &info.event_handler); } else { dispatch(event, &info.shard, &info.data, - &info.event_handler, - &handle); + &info.event_handler); }} - - core.turn(None); } } |