Skip to content

Releases: async-rs/async-std

v1.12.0

18 Jun 22:18
v1.12.0
1130279
Compare
Choose a tag to compare

This release stabilizes some long-awaited APIs that help people build async interfaces and interoperate with other APIs.

Added

  • task::spawn_blocking is now stabilized. We consider it a fundamental API for bridging between blocking code and async code, and we widely use it within async-std's own implementation.
  • Add TryFrom implementations to convert TcpListener, TcpStream, UdpSocket, UnixDatagram, UnixListener, and UnixStream to their synchronous equivalents, including putting them back into blocking mode.

Changed

  • async-std no longer depends on num_cpus; it uses functionality in the standard library instead (via async-global-executor).
  • Miscellaneous documentation fixes and cleanups.

v1.11.0

22 Mar 19:08
2c63046
Compare
Choose a tag to compare

This release improves compile times by up to 55% on initial builds, and up to 75% on recompilation. Additionally we've added a few new APIs and made some tweaks.

Added

  • TcpListener::into_incoming to convert a TcpListener into a stream of incoming TCP connections

Removed

  • The internal extension_trait macro had been removed. This drastically improves compile times for async-std, but changes the way our documentation is rendered. This is a cosmetic change only, and all existing code should continue to work as it did be
    fore.

Changed

  • Some internal code has been de-macro-ified, making for quicker compile times.
  • We now use the default recursion limit.

Docs

  • Several docs improvements / fixes.

v1.9.0

15 Jan 16:27
Compare
Choose a tag to compare

Happy New Year everyone! This patch stabilizes the async_std::channel
submodule, removes the deprecated sync::channel types, and introduces the
tokio1 feature.

New Channels

As part of our 1.8.0 release last month we introduced the new
async_std::channel submodule and deprecated the unstable
async_std::sync::channel types. You can read our full motiviation for this
change in the last patch notes. But the short version is that the old
channels had some fundamental problems, and the sync submodule is a bit of
a mess.

This release of async-std promotes async_std::channel to stable, and
fully removes the async_std::sync::channel types. In practice many
libraries have already been upgraded to the new channels in the past month,
and this will enable much of the ecosystem to switch off "unstable" versions
of async-std.

use async_std::channel;

let (sender, receiver) = channel::unbounded();

assert_eq!(sender.send("Hello").await, Ok(()));
assert_eq!(receiver.recv().await, Ok("Hello"));

Tokio 1.0 compat

The Tokio project recently released version 1.0 of their runtime, and the
async-std team would like to congratulate the Tokio team on achieving this
milestone.

This release of async-std adds the tokio1 feature flag, enabling Tokio's
TLS constructors to be initialized within the async-std runtime. This is in
addition to the tokio02 and tokio03 feature flags which we were already
exposing.

In terms of stability it's worth noting that we will continue to provide
support for the tokio02, tokio03, and tokio1 on the current major
release line of async-std. These flags are part of our public API, and
removing compat support for older Tokio versions is considered a breaking
change.

Added

  • Added the tokio1 feature (#924)
  • Stabilized the async_std::channel submodule (#934)

Removed

  • Removed deprecated sync::channel (#933)

Fixed

  • Fixed a typo for [sic] FuturesExt trait (#930)
  • Update the link to cargo-edit in the installation section of the docs (#932)
  • Fixed a small typo for stream (#926)

Internal

  • Updated rand to 0.8 (#923)
  • Migrated RwLock and Barrier to use the async-lock crate internally (#925)
  • Replaced uses of deprecated the compare_and_swap method with compare_exchange (#927)

v1.8.0

08 Dec 22:16
fde2f58
Compare
Choose a tag to compare

This patch introduces async_std::channel, a new submodule for our async channels implementation. channels have been one of async-std's most requested features, and have existed as "unstable" for the past year. We've been cautious about stabilizing channels, and this caution turned out to be warranted: we realized our channels could hang indefinitely under certain circumstances, and people ended up expressing a need for unbounded channels.

So today we're introducing the new async_std::channel submodule which exports the async-channel crate, and we're marking the older unstable async_std::sync::channel API as "deprecated". This release includes both APIs, but we intend to stabilize async_std::channel and remove the older API in January. This should give dependent projects a month to upgrade, though we can extend that if it proves to be too short.

The rationale for adding a new top-level channel submodule, rather than extending sync is that the std::sync and async_std::sync submodule are a bit of a mess, and the libs team has been talking about splitting std::sync up into separate modules. The stdlib has to guarantee it'll forever be backwards compatible, but async-std does not (we fully expect a 2.0 once we have async closures & traits). So we're experimenting with this change before std does, with the expectation that this change can serve as a data point when the libs team decides how to proceed in std.

Added

  • async_std::channel as "unstable" #915
  • async_std::process as "unstable" #916

Fixed

  • Fixed mentions of the tokio03 flags in the docs #909
  • Fixed a double drop issue in StreamExt::cycle #903

Internal

  • updated pin-project to v0.2.0

v1.7.0

04 Nov 10:25
0f50f3c
Compare
Choose a tag to compare

docs.rs documentation

This patch adds a feature to enable compatibility with the new tokio 0.3.0 release, and updates internal dependencies.

Tokio 0.3.x compat

Since earlier this year async-std has shipped with a tokio-02 feature flag that enables libraries written for the tokio runtime to work on async-std as well. When this flag is enabled async-std ensures that whenever it spawns a thread on its executor, the right tokio-specific thread state is initialized for it. That means no more thread 'main' panicked at 'not currently running on the Tokio runtime.' errors when running async-std and tokio in the same application.

This patch introduces a new feature flag: tokio-03 which enables the same mechanism for the latest version of the tokio runtime. As applications migrate from tokio 0.2.x to 0.3.x, mixing dependencies that use both async-std and tokio will continue to work.

Added

  • Add tokio03 feature flag (#895)

Internal

  • chore: update dependencies (#897)

v1.6.5

28 Sep 17:29
f09fa42
Compare
Choose a tag to compare

Fixed

  • Fix TcpListener::incoming. (#889)
  • Fix tokio compatability flag. (#882)

v1.6.4

17 Sep 11:23
55fb871
Compare
Choose a tag to compare

Added

  • Added UdpSocket::peek and UdpSocket::peek_from (#853)

Changed

Fixed

  • Ensure UnixStream::into_raw_fd doesn't close the file descriptor (#855)
  • Fixed wasm builds and ensured better dependency management depending on the compile target (#863)

v1.6.3

13 Aug 13:05
9a16081
Compare
Choose a tag to compare

Added

Changed

  • Switched from smol to individual executor parts. (#836)
  • Replaced internal Mutex implementation with async-mutex. (#822)

Fixed

  • Added missing Send guards to Stream::collect. (#665)

v1.6.0

22 May 22:05
6d2a43e
Compare
Choose a tag to compare

Added

  • Added task::spawn_local. (#757)
  • Added out of the box support for wasm. (#757)
  • Added JoinHandle::cancel (#757)
  • Added sync::Condvar (#369)
  • Added sync::Sender::try_send and sync::Receiver::try_recv (#585)
  • Added no_std support for task, future and stream (#680)
  • Added an environment variable to configure the thread pool size of the runtime. (#774)
  • Implement Clone for UnixStream (#772)

Changed

  • Switched underlying runtime to smol. (#757)
  • Switched implementation of sync::Barrier to use sync::Condvar like std does. (#581)
  • For wasm, switched underlying Timer implementation to futures-timer. (#776)

Fixed

  • Use smol::block_on to handle drop of File, avoiding nested executor panic. (#768)
  • Allow compilation on 32 bit targets, by using AtomicUsize for TaskId. (#756)

v1.5.0

03 Feb 15:46
39f2c6d
Compare
Choose a tag to compare

API Documentation

This patch includes various quality of life improvements to async-std.
Including improved performance, stability, and the addition of various
Clone impls that replace the use of Arc in many cases.

Added

  • Added links to various ecosystem projects from the README (#660)
  • Added an example on FromStream for Result<T, E> (#643)
  • Added stream::pending as "unstable" (#615)
  • Added an example of stream::timeout to document the error flow (#675)
  • Implement Clone for DirEntry (#682)
  • Implement Clone for TcpStream (#689)

Changed

  • Removed internal comment on stream::Interval (#645)
  • The "unstable" feature can now be used without requiring the "default" feature (#647)
  • Removed unnecessary trait bound on stream::FlatMap (#651)
  • Updated the "broadcaster" dependency used by "unstable" to 1.0.0 (#681)
  • Updated async-task to 1.2.1 (#676)
  • task::block_on now parks after a single poll, improving performance in many cases (#684)
  • Improved reading flow of the "client" part of the async-std tutorial (#550)
  • Use take_while instead of scan in impl of Product, Sum and FromStream (#667)
  • TcpStream::connect no longer uses a thread from the threadpool, improving performance (#687)

Fixed

  • Fixed crate documentation typo (#655)
  • Fixed documentation for UdpSocket::recv (#648)
  • Fixed documentation for UdpSocket::send (#671)
  • Fixed typo in stream documentation (#650)
  • Fixed typo on sync::JoinHandle documentation (#659)
  • Removed use of std::error::Error::description which failed CI (#661)
  • Removed the use of rustfmt's unstable format_code_in_doc_comments option which failed CI (#685)
  • Fixed a code typo in the task::sleep example (#688)