futures-rs v0.1.4 Release Notes
Release Date: 2016-11-22 // over 7 years ago-
๐ This is quite a large release relative to the previous point releases! As ๐ with all 0.1 releases, this release should be fully compatible with the 0.1.3 ๐ release. If any incompatibilities are discovered please file an issue!
The largest changes in 0.1.4 are the addition of a
Sink
trait coupled with a reorganization of this crate. Note that all old locations for types/traits ๐ still exist, they're just deprecated and tagged with#[doc(hidden)]
.The new
Sink
trait is used to represent types which can periodically over time accept items, but may take some time to fully process the item before another can be accepted. Essentially, a sink is the opposite of a stream. This trait will then be used in the tokio-core crate to implement simple framing by modeling I/O streams as both a stream and a sink of frames.The organization of this crate is to now have three primary submodules,
future
,stream
, andsink
. The traits as well as all combinator types are ๐ defined in these submodules. The traits and types likeAsync
andPoll
are then reexported at the top of the crate for convenient usage. It should be a relatively rare occasion that the modules themselves are reached into.๐ Finally, the 0.1.4 release comes with a new module,
sync
, in the futures crate. This is intended to be the home of a suite of futures-aware ๐ synchronization primitives. Currently this is inhabited with aoneshot
module (the oldoneshot
function), ampsc
module for a new multi-producer single-consumer channel, and aBiLock
type which represents sharing ownership of one value between two consumers. This module may expand over time with more types like a mutex, rwlock, spsc channel, etc.๐ Notable deprecations in the 0.1.4 release that will be deleted in an eventual ๐ 0.2 release:
- ๐ The
TaskRc
type is now deprecated in favor ofBiLock
or otherwiseArc
sharing. - All future combinators should be accessed through the
future
module, not the top-level of the crate. - ๐ The
Oneshot
andComplete
types are now replaced with thesync::oneshot
module. - ๐ Some old names like
collect
are deprecated in favor of more appropriately named versions likejoin_all
- The
finished
constructor is nowok
. - The
failed
constructor is nowerr
. - The
done
constructor is nowresult
.
As always, please report bugs to https://github.com/rust-lang-nursery/futures-rs and we always love feedback! If you've got situations we don't cover, combinators ๐ you'd like to see, or slow code, please let us know!
Full changelog:
- ๐ Improve scalability of
buffer_unordered
combinator - ๐ Fix a memory ordering bug in oneshot
- โ Add a new trait,
Sink
- Reorganize the crate into three primary modules
- โ Add a new
sync
module for synchronization primitives - โ Add a
BiLock
sync primitive for two-way sharing - ๐ Deprecate
TaskRc
- ๐ Rename
collect
tojoin_all
- ๐ Use a small vec in
Events
for improved clone performance - โ Add
Stream::select
for selecting items from two streams likemerge
but requiring the same types. - โ Add
stream::unfold
constructor - โ Add a
sync::mpsc
module with a futures-aware multi-producer single-consumer queue. Both bounded (with backpressure) and unbounded (no backpressure) variants are provided. - ๐ Renamed
failed
,finished
, anddone
combinators toerr
,ok
, andresult
. - โ Add
Stream::forward
to send all items to a sink, likeSink::send_all
- โ Add
Stream::split
for streams which are both sinks and streams to have separate ownership of the stream/sink halves - ๐ Improve
join_all
with concurrency
- ๐ The