futures-rs v0.1.14 Release Notes

Release Date: 2017-05-30 // almost 7 years ago
  • ๐Ÿš€ This is a relatively large release of the futures crate, although much of it is from reworking internals rather than new APIs. The banner feature of this ๐Ÿš€ release is that the futures::{task, executor} modules are now available in ๐Ÿ”จ no_std contexts! A large refactoring of the task system was performed in ๐Ÿšš PR #436 to accommodate custom memory allocation schemes and otherwise remove all dependencies on std for the task module. More details about this change can be found on the PR itself.

    ๐Ÿš€ Other API additions in this release are:

    • A FuturesUnordered::push method was added and the FuturesUnordered type itself was completely rewritten to efficiently track a large number of futures.
    • ๐Ÿ”” A Task::will_notify_current method was added with a slightly different implementation than Task::is_current but with stronger guarantees and documentation wording about its purpose.
    • Many combinators now have get_ref, get_mut, and into_inner methods for accessing internal futures and state.
    • ๐Ÿ›  A Stream::concat2 method was added which should be considered the "fixed" version of concat, this one doesn't panic on empty streams.
    • An Executor trait has been added to represent abstracting over the concept of spawning a new task. Crates which only need the ability to spawn a future can now be generic over Executor rather than requiring a tokio_core::reactor::Handle.

    ๐Ÿš€ As with all 0.1.x releases this PR is intended to be 100% backwards compatible. All code that previously compiled should continue to do so with these changes. โšก๏ธ As with other changes, though, there are also some updates to be aware of:

    • The task::park function has been renamed to task::current.
    • The Task::unpark function has been renamed to Task::notify, and in general terminology around "unpark" has shifted to terminology around "notify"
    • ๐Ÿ—„ The Unpark trait has been deprecated in favor of the Notify trait mentioned above.
    • ๐Ÿ—„ The UnparkEvent structure has been deprecated. It currently should perform the same as it used to, but it's planned that in a future 0.1.x release the performance will regress for crates that have not transitioned away. The primary primitive to replace this is the addition of a push function on the FuturesUnordered type. If this does not help implement your use case though, please let us know!
    • ๐Ÿ—„ The Task::is_current method is now deprecated, and you likely want to use Task::will_notify_current instead, but let us know if this doesn't suffice!