summaryrefslogtreecommitdiffstats
path: root/src/executor.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-11-25 03:06:24 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-11-25 03:06:24 +0100
commit782dd2f5222bfef5e12aa576a821da21126505b7 (patch)
treeef43d15531134d4c92dedca14682d70d0c614a00 /src/executor.rs
parenta4ad1b297e97d6c3efc196681822f127efc954cc (diff)
downloadiced-782dd2f5222bfef5e12aa576a821da21126505b7.tar.gz
iced-782dd2f5222bfef5e12aa576a821da21126505b7.tar.bz2
iced-782dd2f5222bfef5e12aa576a821da21126505b7.zip
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.
Diffstat (limited to 'src/executor.rs')
-rw-r--r--src/executor.rs16
1 files changed, 13 insertions, 3 deletions
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.