From eacb2e913fdbfe7af735ec0f4041599a87ad318a Mon Sep 17 00:00:00 2001 From: valbendan Date: Thu, 5 Nov 2020 11:36:23 +0800 Subject: upgrade tokio to latest version(v0.3) --- src/executor.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/executor.rs b/src/executor.rs index ea6ab14a..34538fb6 100644 --- a/src/executor.rs +++ b/src/executor.rs @@ -40,7 +40,8 @@ mod platform { } fn enter(&self, f: impl FnOnce() -> R) -> R { - self.0.enter(f) + let _guard = self.0.enter(); + f() } } } -- cgit From a4ad1b297e97d6c3efc196681822f127efc954cc Mon Sep 17 00:00:00 2001 From: dabaichi Date: Fri, 6 Nov 2020 04:20:19 +0000 Subject: Update src/executor.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix executor other than tokio Co-authored-by: Héctor Ramón --- src/executor.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/executor.rs b/src/executor.rs index 34538fb6..13a3990b 100644 --- a/src/executor.rs +++ b/src/executor.rs @@ -40,8 +40,7 @@ mod platform { } fn enter(&self, f: impl FnOnce() -> R) -> R { - let _guard = self.0.enter(); - f() + super::Executor::enter(&self.0, f) } } } -- cgit From 782dd2f5222bfef5e12aa576a821da21126505b7 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 25 Nov 2020 03:06:24 +0100 Subject: Introduce `tokio_old` feature This feature allows users to rely on the `0.2` version of `tokio` while the async ecosystem upgrades to the latest version. --- src/executor.rs | 16 +++++++++++++--- src/lib.rs | 11 +++++++++-- 2 files changed, 22 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/executor.rs b/src/executor.rs index 13a3990b..0333bc1d 100644 --- a/src/executor.rs +++ b/src/executor.rs @@ -7,13 +7,23 @@ pub use platform::Default; mod platform { use iced_futures::{executor, futures}; - #[cfg(feature = "tokio")] + #[cfg(feature = "tokio_old")] + type Executor = executor::TokioOld; + + #[cfg(all(not(feature = "tokio_old"), feature = "tokio"))] type Executor = executor::Tokio; - #[cfg(all(not(feature = "tokio"), feature = "async-std"))] + #[cfg(all( + not(any(feature = "tokio_old", feature = "tokio")), + feature = "async-std" + ))] type Executor = executor::AsyncStd; - #[cfg(not(any(feature = "tokio", feature = "async-std")))] + #[cfg(not(any( + feature = "tokio_old", + feature = "tokio", + feature = "async-std" + )))] type Executor = executor::ThreadPool; /// A default cross-platform executor. diff --git a/src/lib.rs b/src/lib.rs index 610683b3..6b61d297 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -193,10 +193,17 @@ pub mod widget; pub mod window; #[cfg(all( - any(feature = "tokio", feature = "async-std"), + any(feature = "tokio", feature = "tokio_old", feature = "async-std"), not(target_arch = "wasm32") ))] -#[cfg_attr(docsrs, doc(cfg(any(feature = "tokio", feature = "async-std"))))] +#[cfg_attr( + docsrs, + doc(cfg(any( + feature = "tokio", + feature = "tokio_old", + feature = "async-std" + ))) +)] pub mod time; #[cfg(all( -- cgit