Skip to content

Commit

Permalink
executor: move into tokio crate
Browse files Browse the repository at this point in the history
A step towards collapsing Tokio sub crates into a single `tokio`
crate (#1318).

The executor implementation is now provided by the main `tokio` crate.
Functionality can be opted out of by using the various net related
feature flags.
  • Loading branch information
carllerche committed Oct 28, 2019
1 parent 474befd commit 2e45b77
Show file tree
Hide file tree
Showing 90 changed files with 368 additions and 493 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

members = [
"tokio",
"tokio-executor",
"tokio-macros",
"tokio-sync",
"tokio-test",
Expand Down
38 changes: 18 additions & 20 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ jobs:
displayName: Test sub crates -
rust: beta
crates:
tokio-executor:
- current-thread
- thread-pool
tokio-sync:
- async-traits
tokio-macros: []
Expand All @@ -58,30 +55,31 @@ jobs:
examples: []

# Test compilation failure
- template: ci/azure-test-stable.yml
parameters:
name: test_features
displayName: Test feature flags
rust: beta
crates:
tests-build:
- tokio-executor
- executor-without-current-thread
# - macros-invalid-input
# - net-no-features
# - net-with-tcp
# - net-with-udp
# - net-with-uds
# - tokio-no-features
# - tokio-with-net
# Disable pending: https://github.com/tokio-rs/tokio/pull/1695#issuecomment-547045383
# - template: ci/azure-test-stable.yml
# parameters:
# name: test_features
# displayName: Test feature flags
# rust: beta
# crates:
# tests-build:
# # - tokio-executor
# # - executor-without-current-thread
# # - macros-invalid-input
# # - net-no-features
# # - net-with-tcp
# # - net-with-udp
# # - net-with-uds
# # - tokio-no-features
# # - tokio-with-net

# Run loom tests
- template: ci/azure-loom.yml
parameters:
name: loom
rust: beta
crates:
- tokio-executor
- tokio

# Try cross compiling
- template: ci/azure-cross-compile.yml
Expand Down
2 changes: 0 additions & 2 deletions ci/azure-tsan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ jobs:
matrix:
Timer:
cmd: cargo test -p tokio-timer --test hammer
Threadpool:
cmd: cargo test -p tokio-executor --tests --features threadpool
pool:
vmImage: ubuntu-16.04
steps:
Expand Down
1 change: 0 additions & 1 deletion ci/patch.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# repository.
[patch.crates-io]
tokio = { path = "tokio" }
tokio-executor = { path = "tokio-executor" }
tokio-macros = { path = "tokio-macros" }
tokio-sync = { path = "tokio-sync" }
tokio-tls = { path = "tokio-tls" }
Expand Down
3 changes: 1 addition & 2 deletions tests-build/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2018"
publish = false

[features]
executor-without-current-thread = ["tokio-executor"]
# executor-without-current-thread = ["tokio-executor"]
# macros-invalid-input = ["tokio/rt-full"]
# net-no-features = ["tokio-net"]
# net-with-tcp = ["tokio-net/tcp"]
Expand All @@ -19,7 +19,6 @@ executor-without-current-thread = ["tokio-executor"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
tokio-executor = { path = "../tokio-executor", optional = true }
# tokio = { path = "../tokio", optional = true, default-features = false }

[dev-dependencies]
Expand Down
102 changes: 0 additions & 102 deletions tokio-executor/src/lib.rs

This file was deleted.

1 change: 0 additions & 1 deletion tokio-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ categories = ["asynchronous", "testing"]

[dependencies]
tokio = { version = "=0.2.0-alpha.6", path = "../tokio" }
tokio-executor = { version = "=0.2.0-alpha.6", path = "../tokio-executor" }
tokio-sync = { version = "=0.2.0-alpha.6", path = "../tokio-sync" }

bytes = "0.4"
Expand Down
2 changes: 1 addition & 1 deletion tokio-test/src/clock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
//! });
//! ```

use tokio::executor::park::{Park, Unpark};
use tokio::timer::clock::{Clock, Now};
use tokio::timer::Timer;
use tokio_executor::park::{Park, Unpark};

use std::marker::PhantomData;
use std::rc::Rc;
Expand Down
2 changes: 1 addition & 1 deletion tokio-test/src/task.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Futures task based helpers

use tokio_executor::enter;
use tokio::executor::enter;

use pin_convert::AsPinMut;
use std::future::Future;
Expand Down
14 changes: 8 additions & 6 deletions tokio/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ keywords = ["io", "async", "non-blocking", "futures"]

[features]
default = [
"blocking",
"fs",
"io",
"net-full",
Expand All @@ -35,25 +36,25 @@ default = [
"timer",
]

fs = ["tokio-executor/blocking"]
blocking = []
fs = ["blocking"]
io-traits = ["bytes", "iovec"]
io-util = ["io-traits", "pin-project", "memchr"]
io = ["io-traits", "io-util"]
macros = ["tokio-macros"]
net-full = ["tcp", "udp", "uds"]
net-driver = ["mio", "tokio-executor/blocking"]
net-driver = ["mio", "blocking"]
rt-current-thread = [
"crossbeam-channel",
"timer",
"tokio-executor/current-thread",
]
rt-full = [
"macros",
"num_cpus",
"net-full",
"rt-current-thread",
"sync",
"timer",
"tokio-executor/current-thread",
"tokio-executor/thread-pool",
]
signal = [
"lazy_static",
Expand Down Expand Up @@ -86,6 +87,7 @@ futures-util-preview = { version = "=0.3.0-alpha.19", features = ["sink"] }

# Everything else is optional...
bytes = { version = "0.4", optional = true }
crossbeam-channel = { version = "0.3.8", optional = true }
crossbeam-utils = { version = "0.6.0", optional = true }
iovec = { version = "0.1", optional = true }
lazy_static = { version = "1.0.2", optional = true }
Expand All @@ -95,7 +97,6 @@ num_cpus = { version = "1.8.0", optional = true }
pin-project = { version = "0.4", optional = true }
# Backs `DelayQueue`
slab = { version = "0.4.1", optional = true }
tokio-executor = { version = "=0.2.0-alpha.6", optional = true, path = "../tokio-executor" }
tokio-macros = { version = "=0.2.0-alpha.6", optional = true, path = "../tokio-macros" }
tokio-sync = { version = "=0.2.0-alpha.6", optional = true, path = "../tokio-sync", features = ["async-traits"] }

Expand Down Expand Up @@ -123,6 +124,7 @@ flate2 = { version = "1", features = ["tokio"] }
http = "0.1"
httparse = "1.0"
libc = "0.2"
loom = { version = "0.2.11", features = ["futures", "checkpoint"] }
num_cpus = "1.0"
rand = "0.7.2"
serde = { version = "1.0", features = ["derive"] }
Expand Down
104 changes: 0 additions & 104 deletions tokio/src/executor.rs

This file was deleted.

Loading

0 comments on commit 2e45b77

Please sign in to comment.