summaryrefslogtreecommitdiffstats
path: root/tests-integration
AgeCommit message (Collapse)Author
2020-10-12rt: simplify rt-* features (#2949)Taiki Endo
tokio: merge rt-core and rt-util as rt rename rt-threaded to rt-multi-thread tokio-util: rename rt-core to rt Closes #2942
2020-10-12rt: Remove `threaded_scheduler()` and `basic_scheduler()` (#2876)Lucio Franco
Co-authored-by: Alice Ryhl <alice@ryhl.io> Co-authored-by: Carl Lerche <me@carllerche.com>
2020-09-07process: add Child::{wait,try_wait} (#2796)Ivan Petkov
* add Child::try_wait to mirror the std API * replace Future impl on Child with `.wait()` method to bring our APIs closer to those in std and it allow us to internally fuse the future so that repeated calls to `wait` result in the same value (similar to std) without forcing the caller to fuse the outer future * Also change `Child::id` to return an Option result to avoid allowing the caller to accidentally use the pid on Unix systems after the child has been reaped * Also remove deprecated Child methods
2020-08-27rt: Refactor `Runtime::block_on` to take `&self` (#2782)Lucio Franco
Co-authored-by: Eliza Weisman <eliza@buoyant.io>
2020-03-20rt: remove `unsafe` from shell runtime. (#2333)Carl Lerche
Since the original shell runtime was implemented, utilities have been added to encapsulate `unsafe`. The shell runtime is now able to use those utilities and not include its own `unsafe` code.
2020-01-26macros: fix skipping generics on #[tokio::main] (#2177)daxpedda
When using #[tokio::main] on a function with generics, the generics are skipped. Simply using #vis #sig instead of #vis fn #name(#inputs) #ret fixes the problem. Fixes #2176
2020-01-23macros: add pin! macro (#2163)Carl Lerche
Used for stack pinning and based on `pin_mut!` from the pin-util crate. Pinning is used often when working with stream operators and the select! macro. Given the small size of `pin!` it makes more sense to include a version than re-export one from a separate crate or require the user to depend on `pin-util` themselves.
2020-01-22Provide `select!` macro (#2152)Carl Lerche
Provides a `select!` macro for concurrently waiting on multiple async expressions. The macro has similar goals and syntax as the one provided by the `futures` crate, but differs significantly in implementation. First, this implementation does not require special traits to be implemented on futures or streams (i.e., no `FuseFuture`). A design goal is to be able to pass a "plain" async fn result into the select! macro. Even without `FuseFuture`, this `select!` implementation is able to handle all cases the `futures::select!` macro can handle. It does this by supporting pre-poll conditions on branches and result pattern matching. For pre-conditions, each branch is able to include a condition that disables the branch if it evaluates to false. This allows the user to guard futures that have already been polled, preventing double polling. Pattern matching can be used to disable streams that complete. A second big difference is the macro is implemented almost entirely as a declarative macro. The biggest advantage to using this strategy is that the user will not need to alter the rustc recursion limit except in the most extreme cases. The resulting future also tends to be smaller in many cases.
2020-01-21macros: fix `#[tokio::main]` without rt-core (#2139)Carl Lerche
The Tokio runtime provides a "shell" runtime when `rt-core` is not available. This shell runtime is enough to support `#[tokio::main`] and `#[tokio::test]. A previous change disabled these two attr macros when `rt-core` was not selected. This patch fixes this by re-enabling the `main` and `test` attr macros without `rt-core` and adds some integration tests to prevent future regressions.
2020-01-06process: deprecate Child stdio accessors in favor of pub fields (#2014)Ivan Petkov
Fixes #2009
2019-11-22default all feature flags to off (#1811)Carl Lerche
Changes the set of `default` feature flags to `[]`. By default, only core traits are included without specifying feature flags. This makes it easier for users to pick the components they need. For convenience, a `full` feature flag is included that includes all components. Tests are configured to require the `full` feature. Testing individual feature flags will need to be moved to a separate crate. Closes #1791
2019-11-15Limit `futures` dependency to `Stream` via feature flag (#1774)Carl Lerche
In an effort to reach API stability, the `tokio` crate is shedding its _public_ dependencies on crates that are either a) do not provide a stable (1.0+) release with longevity guarantees or b) match the `tokio` release cadence. Of course, implementing `std` traits fits the requirements. The on exception, for now, is the `Stream` trait found in `futures_core`. It is expected that this trait will not change much and be moved into `std. Since Tokio is not yet going reaching 1.0, I feel that it is acceptable to maintain a dependency on this trait given how foundational it is. Since the `Stream` implementation is optional, types that are logically streams provide `async fn next_*` functions to obtain the next value. Avoiding the `next()` name prevents fn conflicts with `StreamExt::next()`. Additionally, some misc cleanup is also done: - `tokio::io::io` -> `tokio::io::util`. - `delay` -> `delay_until`. - `Timeout::new` -> `timeout(...)`. - `signal::ctrl_c()` returns a future instead of a stream. - `{tcp,unix}::Incoming` is removed (due to lack of `Stream` trait). - `time::Throttle` is removed (due to lack of `Stream` trait). - Fix: `mpsc::UnboundedSender::send(&self)` (no more conflict with `Sink` fns).
2019-11-07chore: update futures to 0.3.0 (#1741)Taiki Endo
2019-10-25net: move into tokio crate (#1683)Carl Lerche
A step towards collapsing Tokio sub crates into a single `tokio` crate (#1318). The `net` implementation is now provided by the main `tokio` crate. Functionality can be opted out of by using the various net related feature flags.