v0.99.9
This patch upgrades our futures-rs version, allowing us to build on the 1.39
beta. Additionally we've introduced map and for_each to Stream. And we've
added about a dozen new FromStream implementations for std types, bringing
us up to par with std's FromIterator implementations.
And finally we've added a new "unstable" task::blocking function which can be
used to convert blocking code into async code using a threadpool. We've been
using this internally for a while now to async-std to power our fs and
net::SocketAddr implementations. With this patch userland code now finally has
access to this too.
Example
Create a stream of tuples, and collect into a hashmap
let a = stream::once(1u8);
let b = stream::once(0u8);
let s = a.zip(b);
let map: HashMap<u8, u8> = s.collect().await;
assert_eq!(map.get(&1), Some(&0u8));Spawn a blocking task on a dedicated threadpool
task::blocking(async {
println!("long-running task here");
}).await;Added
- Added
stream::Stream::map - Added
stream::Stream::for_each - Added
stream::Stream::try_for_each - Added
task::blockingas "unstable" - Added
FromStreamfor allstd::{option, collections, result, string, sync}types. - Added the
pathsubmodule as "unstable".
Changed
- Updated
futures-previewto0.3.0-alpha.19, allowing us to build onrustc 1.39.0-beta. - As a consequence of this upgrade, all of our concrete stream implementations
now make use ofStream::size_hintto optimize internal allocations. - We now use GitHub Actions through actions-rs,
in addition to Travis CI. We intend to fully switch in the near future. - Fixed a bug introduced in 0.99.6 where Unix Domain Listeners would sometimes become unresponsive.
- Updated our
sync::Barrierdocs to match std. - Updated our
stream::FromStreamdocs to match std'sFromIterator.