summaryrefslogtreecommitdiffstats
path: root/tokio/src/macros/mod.rs
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-03-05rt: cleanup and simplify scheduler (scheduler v2.5) (#2273)Carl Lerche
A refactor of the scheduler internals focusing on simplifying and reducing unsafety. There are no fundamental logic changes. * The state transitions of the core task component are refined and reduced. * `basic_scheduler` has most unsafety removed. * `local_set` has most unsafety removed. * `threaded_scheduler` limits most unsafety to its queue implementation.
2020-01-29macros: correctly feature gate join/try_join (#2196)Carl Lerche
The `macros` feature flag was ommitted despite the fact that these macros require the feature flag to function. The macros are now scoped by the `macros` feature flag. This is *not* a breaking change due to the fact that the macros were broken without the `macros` feature flag in the first place.
2020-01-24future: provide try_join! macro (#2169)Carl Lerche
Provides a `try_join!` macro that supports concurrently driving multiple `Result` futures on the same task and await the completion of all the futures as `Ok` or the **first** `Err` future.
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-23future: provide join! macro (#2158)Carl Lerche
Provides a `join!` macro that supports concurrently driving multiple futures on the same task and await the completion of all futures.
2020-01-23Don't export select unless macros is enabled (#2161)John-John Tedro
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.
2019-11-18chore: refine feature flags (#1785)Carl Lerche
Removes dependencies between Tokio feature flags. For example, `process` should not depend on `sync` simply because it uses the `mpsc` channel. Instead, feature flags represent **public** APIs that become available with the feature enabled. When the feature is not enabled, the functionality is removed. If another Tokio component requires the functionality, it is stays as `pub(crate)`. The threaded scheduler is now exposed under `rt-threaded`. This feature flag only enables the threaded scheduler and does not include I/O, networking, or time. Those features must be explictly enabled. A `full` feature flag is added that enables all features. `stdin`, `stdout`, `stderr` are exposed under `io-std`. Macros are used to scope code by feature flag.