From 7c4b052d7b5a50f234721249bd0221f037e48ea9 Mon Sep 17 00:00:00 2001 From: Zeyla Hellyer Date: Mon, 18 Sep 2017 18:10:12 -0700 Subject: Fix block on spawning multiple shards When spawning multiple shards (via an equal number of futures - one per shard) joined on a core.run use, the very first future executed would block forever due to a sync, blocking `monitor_shard` use. While this defeats the purpose of tokio, this was meant to be a first step to an async serenity implementation. To "fix" this blocking call until a deeper async implementation is made, spawn a new thread per tokio core (and thus per shard). This causes the same expected behaviour, just with multiple threads like before. --- src/client/dispatch.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/client/dispatch.rs') diff --git a/src/client/dispatch.rs b/src/client/dispatch.rs index 494ab6d..490f4b6 100644 --- a/src/client/dispatch.rs +++ b/src/client/dispatch.rs @@ -45,7 +45,7 @@ fn context(conn: &Arc>, data: &Arc>, handle: &Handl #[cfg(feature = "framework")] pub fn dispatch(event: Event, conn: &Arc>, - framework: &Arc>>>, + framework: &Arc>>>, data: &Arc>, event_handler: &Arc, tokio_handle: &Handle) { -- cgit v1.2.3