Changelog History
Page 3
-
v1.0.0 Changes
November 11, 2019๐ API Documentation
๐ This release marks the
1.0.0
release of async-std; a major milestone for our ๐ development. This release itself mostly includes quality of life improvements for all of modules, including more consistent API bounds for a lot of our submodules.The biggest change is that we're now using the full semver range,
major.minor.patch
, and any breaking changes to our "stable" APIs will require โก๏ธ an update of themajor
number.We're excited we've hit this milestone together with you all. Thank you!
โ Added
- โ Added
Future::join
as "unstable", replacingfuture::join!
. - Added
Future::try_join
as "unstable", replacingfuture::try_join!
. - โ
Enabled
stable
andbeta
channel testing on CI. - Implemented
FromIterator
andExtend
forPathBuf
. - Implemented
FromStream
forPathBuf
. - Loosened the trait bounds of
io::copy
on "unstable".
๐ Changed
- โ Added a
Sync
bound toRwLock
, resolving a memory safety issue. - ๐ Fixed a bug in
Stream::take_while
where it could continue after it should've ended. - ๐ Fixed a bug where our
attributes
Cargo feature wasn't working as intended. - ๐ Improved documentation of
Stream::merge
, documenting ordering guarantees. - โก๏ธ Update doc imports in examples to prefer async-std's types.
- Various quality of life improvements to the
future
submodule. - Various quality of life improvements to the
path
submodule. - Various quality of life improvements to the
stream
submodule.
โ Removed
- โ Removed
future::join!
in favor ofFuture::join
. - Removed
future::try_join!
in favor ofFuture::try_join
.
- โ Added
-
v0.99.12 Changes
November 07, 2019๐ API Documentation
โฌ๏ธ This patch upgrades us to
futures
0.3, support forasync/await
on Rust ๐ Stable, performance improvements, and brand new module-level documentation.โ Added
- โ Added
Future::flatten
as "unstable". - โ Added
Future::race
as "unstable" (replacesfuture::select!
). - Added
Future::try_race
as "unstable" (replacesfuture::try_select!
). - โ Added
Stderr::lock
as "unstable". - โ Added
Stdin::lock
as "unstable". - โ Added
Stdout::lock
as "unstable". - โ Added
Stream::copied
as "unstable". - โ Added
Stream::eq
as "unstable". - Added
Stream::max_by_key
as "unstable". - โ Added
Stream::min
as "unstable". - โ Added
Stream::ne
as "unstable". - โ Added
Stream::position
as "unstable". - โ Added
StreamExt
andFutureExt
as enumerable in theprelude
. - โ Added
TcpListener
andTcpStream
integration tests. - โ Added
stream::from_iter
. - โ Added
sync::WakerSet
for internal use. - โ Added an example to handle both
IP v4
andIP v6
connections. - โ Added the
default
Cargo feature. - โ Added the
attributes
Cargo feature. - โ Added the
std
Cargo feature.
๐ Changed
- ๐ Fixed a bug in the blocking threadpool where it didn't spawn more than one thread.
- ๐ Fixed a bug with
Stream::merge
where sometimes it ended too soon. - ๐ Fixed a bug with our GitHub actions setup.
- ๐ Fixed an issue where our channels could spuriously deadlock.
- ๐จ Refactored the
task
module. - โ Removed a deprecated GitHub action.
- Replaced
futures-preview
withfutures
. - Replaced
lazy_static
withonce_cell
. - Replaced all uses of
VecDequeue
in the examples withstream::from_iter
. - ๐ Simplified
sync::RwLock
using the internalsync::WakerSet
type. - ๐ Updated the
path
submodule documentation to match std. - ๐ Updated the mod-level documentation to match std.
โ Removed
- โ Removed
future::select!
(replaced byFuture::race
). - Removed
future::try_select!
(replaced byFuture::try_race
).
- โ Added
-
v0.99.11 Changes
October 29, 2019๐ This patch introduces
async_std::sync::channel
, a novel asynchronous port of the ultra-fast Crossbeam channels. This has been one of the most anticipated ๐ features for async-std, and we're excited to be providing a first version of this!In addition to channels, this patch has the regular list of new methods, types, ๐ and doc fixes.
Examples
Send and receive items from a channel
// Create a bounded channel with a max-size of 1 let (s, r) = channel(1); // This call returns immediately because there is enough space in the channel. s.send(1).await; task::spawn(async move { // This call blocks the current task because the channel is full. // It will be able to complete only after the first message is received. s.send(2).await; }); // Receive items from the channel task::sleep(Duration::from_secs(1)).await; assert_eq!(r.recv().await, Some(1)); assert_eq!(r.recv().await, Some(2));
โ Added
- โ Added
Future::delay
as "unstable" - โ Added
Stream::flat_map
as "unstable" - โ Added
Stream::flatten
as "unstable" - โ Added
Stream::product
as "unstable" - โ Added
Stream::sum
as "unstable" - Added
Stream::min_by_key
- โ Added
Stream::max_by
- โ Added
Stream::timeout
as "unstable" - โ Added
sync::channel
as "unstable". - โ Added doc links from instantiated structs to the methods that create them.
- Implemented
Extend
+FromStream
forPathBuf
.
๐ Changed
- ๐ Fixed an issue with
block_on
so it works even when nested. - ๐ Fixed issues with our Clippy check on CI.
- Replaced our uses of
cfg_if
with our own macros, simplifying the codebase. - โก๏ธ Updated the homepage link in
Cargo.toml
to point to async.rs. - ๐ Updated the module-level documentation for
stream
andsync
. - โ๏ธ Various typos and grammar fixes.
- โ Removed redundant file flushes, improving the performance of
File
operations
โ Removed
๐ Nothing was removed in this release.
- โ Added
-
v0.99.10 Changes
October 16, 2019This patch stabilizes several core concurrency macros, introduces async versions of
Path
andPathBuf
, and adds almost 100 other commits.Examples
Asynchronously read directories from the filesystem
use async_std::fs; use async_std::path::Path; use async_std::prelude::*; let path = Path::new("/laputa"); let mut dir = fs::read_dir(&path).await.unwrap(); while let Some(entry) = dir.next().await { if let Ok(entry) = entry { println!("{:?}", entry.path()); } }
โฑ Cooperatively reschedule the current task on the executor
use async_std::prelude::*; use async_std::task; task::spawn(async { let x = fibonnacci(1000); // Do expensive work task::yield_now().await; // Allow other tasks to run x + fibonnacci(100) // Do more work })
Create an interval stream
use async_std::prelude::*; use async_std::stream; use std::time::Duration; let mut interval = stream::interval(Duration::from_secs(4)); while let Some(_) = interval.next().await { println!("prints every four seconds"); }
โ Added
- โ Added
FutureExt
to theprelude
, allowing us to extendFuture
- โ Added
Stream::cmp
- โ Added
Stream::ge
- โ Added
Stream::last
- โ Added
Stream::le
- โ Added
Stream::lt
- โ Added
Stream::merge
as "unstable", replacingstream::join!
- โ Added
Stream::partial_cmp
- โ Added
Stream::take_while
- โ Added
Stream::try_fold
- โ Added
future::IntoFuture
as "unstable" - โ Added
io::BufRead::split
- โ Added
io::Write::write_fmt
- โ Added
print!
,println!
,eprint!
,eprintln!
macros as "unstable" - โ Added
process
as "unstable", re-exporting std types only for now - โ Added
std::net
re-exports to thenet
submodule - โ Added
std::path::PathBuf
with all associated methods - โ Added
std::path::Path
with all associated methods - โ Added
stream::ExactSizeStream
as "unstable" - โ Added
stream::FusedStream
as "unstable" - โ Added
stream::Product
- โ Added
stream::Sum
- โ Added
stream::from_fn
- โ Added
stream::interval
as "unstable" - โ Added
stream::repeat_with
- โ Added
task::spawn_blocking
as "unstable", replacingtask::blocking
- โ Added
task::yield_now
- โ Added
write!
andwriteln!
macros as "unstable" - Stabilized
future::join!
andfuture::try_join!
- โฑ Stabilized
future::timeout
- Stabilized
path
- Stabilized
task::ready!
๐ Changed
- ๐ Fixed
BufWriter::into_inner
so it callsflush
before yielding - ๐จ Refactored
io::BufWriter
internals - ๐จ Refactored
net::ToSocketAddrs
internals - โ Removed Travis CI entirely
- Rewrote the README.md
- Stabilized
io::Cursor
- Switched bors over to use GitHub actions
- ๐ Updated the
io
documentation to match std'sio
docs - ๐ Updated the
task
documentation to match std'sthread
docs
โ Removed
- โ Removed the "unstable"
stream::join!
in favor ofStream::merge
- โ Removed the "unstable"
task::blocking
in favor oftask::spawn_blocking
- โ Added
-
v0.99.9 Changes
October 08, 2019โฌ๏ธ This patch upgrades our
futures-rs
version, allowing us to build on the 1.39 beta. Additionally we've introducedmap
andfor_each
toStream
. And we've โ added about a dozen newFromStream
implementations forstd
types, bringing us up to par with std'sFromIterator
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 ourfs
andnet::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::blocking
as "unstable" - โ Added
FromStream
for allstd::{option, collections, result, string, sync}
types. - โ Added the
path
submodule as "unstable".
๐ Changed
- โก๏ธ Updated
futures-preview
to0.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 of
Stream::size_hint
to 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::Barrier
docs to match std. - โก๏ธ Updated our
stream::FromStream
docs to match std'sFromIterator
.
- โ Added
-
v0.99.8 Changes
September 28, 2019โ Added
- โ Added README to examples directory.
- โ Added concurrency documentation to the futures submodule.
- โ Added
io::Read::take
method. - โ Added
io::Read::by_ref
method. - โ Added
io::Read::chain
method.
๐ Changed
- โฌ๏ธ Pin futures-preview to
0.3.0-alpha.18
, to avoid rustc upgrade problems. - Simplified extension traits using a macro.
- ๐ Use the
broadcast
module withstd::sync::Mutex
, reducing dependencies.
-
v0.99.7 Changes
September 26, 2019โ Added
- โ Added
future::join
macro as "unstable" - โ Added
future::select
macro as "unstable" - โ Added
future::try_join
macro as "unstable" - โ Added
future::try_select
macro as "unstable" - โ Added
io::BufWriter
struct - โ Added
stream::Extend
trait - โ Added
stream::Stream::chain
method - โ Added
stream::Stream::filter
method - โ Added
stream::Stream::inspect
method - โ Added
stream::Stream::skip_while
method - โ Added
stream::Stream::skip
method - โ Added
stream::Stream::step_by
method - โ Added
sync::Arc
struct from stdlib - โ Added
sync::Barrier
struct as "unstable" - โ Added
sync::Weak
struct from stdlib - โ Added
task::ready
macro as "unstable"
๐ Changed
- ๐ Correctly marked the
pin
submodule as "unstable" in the docs - โก๏ธ Updated tutorial to have certain functions suffixed with
_loop
io
traits are now re-exports of futures-rs types, allowing them to be implementedstream
traits are now re-exports of futures-rs types, allowing them to be implementedprelude::*
now needs to be in scope for functionsio
andstream
traits to work
- โ Added
-
v0.99.6 Changes
September 19, 2019โ Added
- โ Added
stream::Stream::collect
as "unstable" - โ Added
stream::Stream::enumerate
- โ Added
stream::Stream::fuse
- โ Added
stream::Stream::fold
- โ Added
stream::Stream::scan
- โ Added
stream::Stream::zip
- โ Added
stream::join
macro as "unstable" - โ Added
stream::DoubleEndedStream
as "unstable" - โ Added
stream::FromStream
trait as "unstable" - โ Added
stream::IntoStream
trait as "unstable" - โ Added
io::Cursor
as "unstable" - โ Added
io::BufRead::consume
method - โ Added
io::repeat
- โ Added
io::Slice
andio::SliceMut
- โ Added documentation for feature flags
- โ Added
pin
submodule as "unstable" - โ Added the ability to
collect
a stream ofResult<T, E>
s into aResult<impl FromStream<T>, E>
๐ Changed
- ๐จ Refactored the scheduling algorithm of our executor to use work stealing
- ๐จ Refactored the network driver, removing 400 lines of code
- โ Removed the
Send
bound fromtask::block_on
- โ Removed
Unpin
bound fromimpl<T: futures::stream::Stream> Stream for T
- โ Added
-
v0.99.5 Changes
September 12, 2019โ Added
- โ Added tests for
io::timeout
- ๐ Added
io::BufRead::fill_buf
, anasync fn
counterpart topoll_fill_buf
- Added
fs::create_dir_all
- โ Added
future::timeout
, a free function to time out futures after a threshold - โ Added
io::prelude
- โ Added
net::ToSocketAddrs
, a non-blocking version of std'sToSocketAddrs
- โ Added
stream::Stream::all
- โ Added
stream::Stream::filter_map
- โ Added
stream::Stream::find_map
- โ Added
stream::Stream::find
- โ Added
stream::Stream::min_by
- โ Added
stream::Stream::nth
๐ Changed
- ๐ Polished the text and examples of the tutorial
cargo fmt
on all examples- Simplified internals of
TcpStream::connect_to
- ๐ท Modularized our CI setup, enabled a rustfmt fallback, and improved caching
- โฌ๏ธ Reduced our dependency on the
futures-rs
crate, improving compilation times - Split
io::Read
,io::Write
,io::BufRead
, andstream::Stream
into multiple files - ๐
fs::File
now flushes more often to prevent flushes duringseek
- โก๏ธ Updated all dependencies
- ๐ Fixed a bug in the conversion of
File
into raw handle - ๐ Fixed compilation errors on the latest nightly
โ Removed
- โ Added tests for
-
v0.99.4 Changes
August 21, 2019๐ Changes
- โ๏ธ Many small changes in the book, mostly typos
- ๐ Documentation fixes correcting examples
- Now works with recent nightly with stabilised async/await (> 2019-08-21)