v1.1.0
This patch introduces a faster scheduler algorithm, Stream::throttle, and
stabilizes task::yield_now. Additionally we're introducing several more stream
APIs, bringing us to almost complete parity with the standard library.
Furthermore our path submodule now returns more context in errors. So if
opening a file fails, async-std will tell you which file was failed to open,
making it easier to write and debug programs.
Examples
let start = Instant::now();
let mut s = stream::interval(Duration::from_millis(5))
.throttle(Duration::from_millis(10))
.take(3);
s.next().await;
assert!(start.elapsed().as_millis() >= 5);
s.next().await;
assert!(start.elapsed().as_millis() >= 15);
s.next().await;
assert!(start.elapsed().as_millis() >= 25);Added
- Added
Stream::throttleas "unstable". - Added
Stream::countas "unstable". - Added
Stream::maxas "unstable". - Added
Stream::successorsas "unstable". - Added
Stream::by_refas "unstable". - Added
Stream::partitionas "unstable". - Added contextual errors to the
pathsubmodule. - Added
os::windows::symlink_diras "unstable". - Added
os::windows::symlink_fileas "unstable". - Stabilized
task::yield_now.
Fixes
- We now ignore seek errors when rolling back failed
readcalls onFile. - Fixed a bug where
Stream::max_by_keywas returning the wrong result. - Fixed a bug where
Stream::min_by_keywas returning the wrong result.
Changed
- Applied various fixes to the tutorial.
- Fixed an issue with Clippy.
- Optimized an internal code generation macro, improving compilation speeds.
- Removed an
Unpinbound fromstream::Once. - Removed various extra internal uses of
pin_mut!. - Simplified
Stream::anyandStream::all's internals. - The
surfexample is now enabled again. - Tweaked some streams internals.
- Updated
futures-timerto 2.0.0, improving compilation speed. - Upgraded
async-macrosto 2.0.0. Stream::mergenow uses randomized ordering to reduce overall latency.- The scheduler is now more efficient by keeping a slot for the next task to
run. This is similar to Go's scheduler, and Tokio's scheduler. - Fixed the documentation of the
channeltypes to link back to thechannel
function.