summaryrefslogtreecommitdiffstats
path: root/tokio/src/stream
AgeCommit message (Collapse)Author
2020-11-23time: use intrusive lists for timer tracking (#3080)bdonlan
More-or-less a half-rewrite of the current time driver, supporting the use of intrusive futures for timer registration. Fixes: #3028, #3069
2020-11-11stream: add docs regarding futures' StreamExt (#3128)Alice Ryhl
2020-11-03stream: fix StreamMap Default bound (#3093)Artem Vorotnikov
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-10-12time: move error types into `time::error` (#2938)Juan Alvarez
2020-10-08time: rename `Delay` future to `Sleep` (#2932)Juan Alvarez
2020-10-05stream: remove bytes from public API (#2908)Alice Ryhl
2020-10-05io, stream: make ext trait futures !Unpin (#2910)Taiki Endo
Make these future `!Unpin` for compatibility with async trait methods.
2020-10-01time: introduce `sleep` and `sleep_until` functions (#2826)Juan Alvarez
2020-09-29Seal FromStream methods with an internal argument (#2894)Sean McArthur
2020-09-29stream: add iter and iter_mut methods to StreamMap (#2890)Linus Behrbohm
2020-09-24sync: support mpsc send with `&self` (#2861)Carl Lerche
Updates the mpsc channel to use the intrusive waker based sempahore. This enables using `Sender` with `&self`. Instead of using `Sender::poll_ready` to ensure capacity and updating the `Sender` state, `async fn Sender::reserve()` is added. This function returns a `Permit` value representing the reserved capacity. Fixes: #2637 Refs: #2718 (intrusive waiters)
2020-09-24docs: use #[doc(no_inline)] on re-exports (#2874)Taiki Endo
2020-09-09stream: module level docs for tokio::stream (#2786)xd009642
2020-09-02time: move throttle to StreamExt (#2752)Blas Rodriguez Irizar
Ref: #2727
2020-07-13doc: fix typo from "Rust langague" to "Rust language" (#2656)Antoine Murat
* doc: fix typo in addr * doc: fix typo in stream * doc: fix typo in stream/collect
2020-05-21coop: Undo budget decrement on Pending (#2549)Jon Gjengset
This patch updates the coop logic so that the budget is only decremented if a future makes progress (that is, if it returns `Ready`). This is realized by restoring the budget to its former value after `poll_proceed` _unless_ the caller indicates that it made progress. The thinking here is that we always want tasks to make progress when we poll them. With the way things were, if a task polled 128 resources that could make no progress, and just returned `Pending`, then a 129th resource that _could_ make progress would not be polled. Worse yet, this could manifest as a deadlock, if the first 128 resources were all _waiting_ for the 129th resource, since it would _never_ be polled. The downside of this change is that `Pending` resources now do not take up any part of the budget, even though they _do_ take up time on the executor. If a task is particularly aggressive (or unoptimized), and polls a large number of resources that cannot make progress whenever it is polled, then coop will allow it to run potentially much longer before yielding than it could before. The impact of this should be relatively contained though, because tasks that behaved in this way in the past probably ignored `Pending` _anyway_, so whether a resource returned `Pending` due to coop or due to lack of progress may not make a difference to it.
2020-05-21stream: update StreamExt::merge doc (#2520)Alice Ryhl
2020-05-14docs: improve discoverability of codec module (#2523)Geoff Shannon
2020-05-10stream: fix documentation on filter_map (#2511)Tom Ciborski
2020-04-23stream: fix panic in Merge and Chain size_hint (#2430)Mikail Bagishov
2020-04-04test: add Send/Sync tests for all async fns (#2377)Alice Ryhl
Also updates Empty and Pending to be unconditionally Send and Sync.
2020-03-25stream: iter() should yield every so often. (#2343)Carl Lerche
2020-02-02stream: add StreamExt::skip_while (#2205)Tore Pettersen
async version of Iterator::skip_while Refs: #2104
2020-02-01stream: add StreamExt::skip (#2204)Tore Pettersen
skip version of take Refs: #2104
2020-01-31stream: provide `StreamMap` utility (#2185)Carl Lerche
`StreamMap` is similar to `StreamExt::merge` in that it combines source streams into a single merged stream that yields values in the order that they arrive from the source streams. However, `StreamMap` has a lot more flexibility in usage patterns. `StreamMap` can: - Merge an arbitrary number of streams. - Track which source stream the value was received from. - Handle inserting and removing streams from the set of managed streams at any point during iteration. All source streams held by `StreamMap` are indexed using a key. This key is included with the value when a source stream yields a value. The key is also used to remove the stream from the `StreamMap` before the stream has completed streaming. Because the `StreamMap` API moves streams during runtime, both streams and keys must be `Unpin`. In order to insert a `!Unpin` stream into a `StreamMap`, use `pin!` to pin the stream to the stack or `Box::pin` to pin the stream in the heap.
2020-01-28docs: fix `stream::pending()` example (#2189)Tore
2020-01-24stream: add StreamExt::timeout() (#2149)Juan Alvarez
2020-01-23stream: add `StreamExt::fold()` (#2122)Artem Vorotnikov
2020-01-16chore: minor fixes (#2121)Artem Vorotnikov
* One more clippy fix, remove special instructions from CI * Fix Collect description
2020-01-13stream: add `StreamExt::collect()` (#2109)Carl Lerche
Provides an asynchronous equivalent to `Iterator::collect()`. A sealed `FromStream` trait is added. Stabilization is pending Rust supporting `async` trait fns.
2020-01-11stream: add `StreamExt::chain` (#2093)Carl Lerche
Asynchronous equivalent to `Iterator::chain`.
2020-01-11stream: add stream::once (#2094)Carl Lerche
An async equivalent to `iter::once`
2020-01-11stream: add `empty()` and `pending()` (#2092)Carl Lerche
`stream::empty()` is the asynchronous equivalent to `std::iter::empty()`. `pending()` provides a stream that never becomes ready.
2020-01-11stream: add `StreamExt::merge` (#2091)Carl Lerche
Provides an equivalent to stream `select()` from futures-rs. `merge` best describes the operation (vs. `select`). `futures-rs` named the operation "select" for historical reasons and did not rename it back to `merge` in 0.3. The operation is most commonly named `merge` else where as well (e.g. ReactiveX).
2020-01-09stream: add `StreamExt::fuse` (#2085)Carl Lerche
2020-01-07docs: minor tweaks to `StreamExt` API docs (#2066)Carl Lerche
2020-01-06stream: Add StreamExt::any (#2034)Artem Vorotnikov
2020-01-02stream: correct trait bounds for all (#2043)Artem Vorotnikov
2020-01-02stream: add StreamExt::all (#2035)Artem Vorotnikov
2019-12-25stream: add StreamExt::take_while (#2029)Artem Vorotnikov
2019-12-24stream: add StreamExt::take (#2025)Artem Vorotnikov
2019-12-20stream: StreamExt::try_next (#2005)Artem Vorotnikov
2019-12-20stream: filtering utilities (#2001)Artem Vorotnikov
Adds `StreamExt::filter` and `StreamExt::filter_map`.
2019-12-20chore: formatting, docs and clippy (#2000)Artem Vorotnikov
2019-12-18stream: add `next` and `map` utility fn (#1962)Artem Vorotnikov
Introduces `StreamExt` trait. This trait will be used to add utility functions to make working with streams easier. This patch includes two functions: * `next`: a future returning the item in the stream. * `map`: transform each item in the stream.