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.
This commit is contained in:
parent
a4ad1b297e
commit
782dd2f522
10 changed files with 67 additions and 9 deletions
|
|
@ -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.
|
||||
|
|
|
|||
11
src/lib.rs
11
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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue