Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b101008

Browse files
committedSep 22, 2020
fix tokio compatibility
Move it into async-global-executor Fixes #881 Signed-off-by: Marc-Antoine Perennou <[email protected]>
1 parent 4de2d12 commit b101008

File tree

4 files changed

+3
-46
lines changed

4 files changed

+3
-46
lines changed
 

‎Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ alloc = [
5757
"futures-core/alloc",
5858
"pin-project-lite",
5959
]
60-
tokio02 = ["tokio"]
60+
tokio02 = ["async-global-executor/tokio02"]
6161

6262
[dependencies]
6363
async-attributes = { version = "1.1.1", optional = true }
@@ -78,7 +78,7 @@ slab = { version = "0.4.2", optional = true }
7878
surf = { version = "1.0.3", optional = true }
7979

8080
[target.'cfg(not(target_os = "unknown"))'.dependencies]
81-
async-global-executor = { version = "1.0.2", optional = true, features = ["async-io"] }
81+
async-global-executor = { version = "1.2.0", optional = true, features = ["async-io"] }
8282
async-io = { version = "1.0.1", optional = true }
8383
blocking = { version = "1.0.0", optional = true }
8484
futures-lite = { version = "1.0.0", optional = true }

‎src/task/builder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ impl Builder {
168168
TaskLocalsWrapper::set_current(&wrapped.tag, || {
169169
let res = if should_run {
170170
// The first call should run the executor
171-
crate::task::executor::run(wrapped)
171+
async_global_executor::block_on(wrapped)
172172
} else {
173173
futures_lite::future::block_on(wrapped)
174174
};

‎src/task/executor.rs

-41
This file was deleted.

‎src/task/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,6 @@ cfg_default! {
148148
mod block_on;
149149
mod builder;
150150
mod current;
151-
#[cfg(not(target_os = "unknown"))]
152-
pub(crate) mod executor;
153151
mod join_handle;
154152
mod sleep;
155153
#[cfg(not(target_os = "unknown"))]

0 commit comments

Comments
 (0)
Please sign in to comment.