StreamMap
Default
impl bound (#3093).AsyncFd::into_inner()
should deregister the FD (#3104).parking_lot
feature enabled with full
(#3119).AsyncWrite
vectored writes (#3149).UCred
with solaris/illumos (#3085).runtime::Handle
allows spawning onto a runtime (#3079).Notify::notify_waiters()
(#3098).acquire_many()
, try_acquire_many()
to Semaphore
(#3067).Fixes a soundness hole by adding a missing Send
bound to Runtime::spawn_blocking()
.
Send
, fixing soundness hole (#3089).TcpSocket::reuseport()
, TcpSocket::set_reuseport()
(#3083).TcpSocket::reuseaddr()
(#3093).TcpSocket::local_addr()
(#3093).UCred
(#2633).Adds AsyncFd
as a replacement for v0.2's PollEvented
.
RwLockWriteGuard::downgrade()
bug (#2957).AsyncFd
for receiving readiness events on raw FDs (#2903).poll_*
function on UdpSocket
(#2981).UdpSocket::take_error()
(#3051).oneshot::Sender::poll_closed()
(#3032).This release fixes an use-after-free in the IO driver. Additionally, the read_buf
and write_buf
methods have been added back to the IO traits, as the bytes crate is now on track to reach version 1.0 together with Tokio.
copy_buf()
(#2884).AsyncReadExt::read_buf()
, AsyncReadExt::write_buf()
for working with Buf
/BufMut
(#3003).Runtime::spawn_blocking()
(#2980).watch::Sender::is_closed()
(#2991).This represents a 1.0 beta release. APIs are polished and future-proofed. APIs not included for 1.0 stabilization have been removed.
Biggest changes are:
rt-core
and rt-util
are combined to rt
rt-threaded
is renamed to rt-multi-thread
to match builder APItcp
, udp
, uds
, dns
are combied to net
.parking_lot
is included with full
AsyncRead
trait now takes ReadBuf
in order to safely handle reading into uninitialized memory (#2758).Runtime::block_on
now takes &self
(#2782).watch
reworked to decouple receiving a change notification from receiving the value (#2814, #2806).Notify::notify
is renamed to notify_one
(#2822).Child::kill
is now an async fn
that cleans zombies (#2823).const fn
constructors as possible (#2833, #2790)&self
(#2828, #2919, #2934).mpsc
channel supports send
with &self
(#2861).delay_for
and delay_until
to sleep
and sleep_until
(#2826).mio
0.7 (#2893).AsyncSeek
trait is tweaked (#2885).File
operations take &self
(#2930).#[tokio::main]
macro polish (#2876)Runtime::enter
uses an RAII guard instead of a closure (#2954).from_std
function on all sockets no longer sets socket into non-blocking mode (#2893)map
function to lock guards (#2445).blocking_recv
and blocking_send
fns to mpsc
for use outside of Tokio (#2685).Builder::thread_name_fn
for configuring thread names (#1921).FromRawFd
and FromRawHandle
for File
(#2792).Child::wait
and Child::try_wait
(#2796).task::JoinHandle::abort
forcibly cancels a spawned task (#2474).RwLock
write guard to read guard downgrading (#2733).poll_*
functions that take &self
to all net types (#2845)get_mut()
for Mutex
, RwLock
(#2856).mpsc::Sender::closed()
waits for Receiver
half to close (#2840).mpsc::Sender::is_closed()
returns true if Receiver
half is closed (#2726).iter
and iter_mut
to StreamMap
(#2890).AsRawSocket
on windows (#2911).TcpSocket
creates a socket without binding or listening (#2920).AsyncRead
, AsyncWrite
traits (#2882).mio
is removed from the public API. PollEvented
and Registration
are removed (#2893).bytes
from public API. Buf
and BufMut
implementation are removed (#2908).DelayQueue
is moved to tokio-util
(#2897).stdout
and stderr
buffering on windows (#2734).block_on
inside calls to block_in_place
that are themselves inside block_on
(#2645)TcpStream
OwnedWriteHalf
(#2597)AsyncReadExt::read_buf
and AsyncWriteExt::write_buf
(#2612)AsyncRead
implementors (#2525)BufReader
not correctly forwarding poll_write_buf
(#2654)AsyncReadExt::read_line
(#2541)Poll::Pending
no longer decrements the task budget (#2549)AsyncReadExt
and AsyncWriteExt
methods (#1915)tracing
instrumentation to spawned tasks (#2655)Mutex
and RwLock
(via default
constructors) (#2615)ToSocketAddrs
implementation for &[SocketAddr]
(#2604)OpenOptionsExt
for OpenOptions
(#2515)DirBuilder
(#2524)#[test]
attribute in macro expansion (#2503)LocalSet
and task budgeting (#2462).block_in_place
(#2502).broadcast
channel memory without sending a value (#2509).Delay
to a time in the past (#2290)get_mut
, get_ref
, and into_inner
to Lines
(#2450).mio::Ready
argument to PollEvented
(#2419).Handle::spawn_blocking
(#2501).OwnedMutexGuard
for Arc<Mutex<T>>
(#2455).broadcast
closing the channel no longer requires capacity (#2448).max_threads
less than number of CPUs (#2457).block_in_place
in more contexts (#2409, #2410).merge()
and chain()
when using size_hint()
(#2430).runtime::Handle::block_on
(#2437).Semaphore
permit (#2421).LocalSet
was incorrectly marked as Send
(#2398)WriteZero
failure in write_int
(#2334)Mutex
, Semaphore
, and RwLock
futures no longer implement Sync
(#2375)fs::copy
not copying file permissions (#2354)mpsc::Sender
(#2358).DelayQueue
correct wakeup after insert
(#2285).RawFd
, AsRawHandle
for std io types (#2335).RwLock::into_inner
(#2321).pin!
(#2281).UnixStream::poll_shutdown
should call shutdown(Write)
(#2245).EPOLLERR
(#2218).block_in_place
and shutting down the runtime (#2119).core_threads
not specified (#2238).watch::Receiver
struct size (#2191).$MAX-1
(#2184).DelayQueue
after inserting new delay (#2217).pin!
variant that assigns to identifier and pins (#2274).Stream
for Listener
types (#2275).Runtime::shutdown_timeout
waits for runtime to shutdown for specified duration (#2186).StreamMap
merges streams and can insert / remove streams at runtime (#2185).StreamExt::skip()
skips a fixed number of items (#2204).StreamExt::skip_while()
skips items based on a predicate (#2205).Notify
provides basic async
/ await
task notification (#2210).Mutex::into_inner
retrieves guarded data (#2250).mpsc::Sender::send_timeout
sends, waiting for up to specified duration for channel capacity (#2227).Ord
and Hash
for Instant
(#2239).#[tokio::main]
method (#2177).broadcast
potential lost notifications (#2135).parking_lot
internally (#2164).fs::copy
, an async version of std::fs::copy
(#2079).select!
waits for the first branch to complete (#2152).join!
waits for all branches to complete (#2158).try_join!
waits for all branches to complete or the first error (#2169).pin!
pins a value to the stack (#2163).ReadHalf::poll()
and ReadHalf::poll_peak
(#2151)StreamExt::timeout()
sets a per-item max duration (#2149).StreamExt::fold()
applies a function, producing a single value. (#2122).Eq
, PartialEq
for oneshot::RecvError
(#2168).JoinError
cause (#2051).#[tokio::main]
when rt-core
feature flag is not enabled (#2139).AsyncBufRead
from BufStream
impl block (#2108).AsyncRead
incorrectly (#2030).BufStream::with_capacity
(#2125).From
and Default
for RwLock
(#2089).io::ReadHalf::is_pair_of
checks if provided WriteHalf
is for the same underlying object (#1762, #2144).runtime::Handle::try_current()
returns a handle to the current runtime (#2118).stream::empty()
returns an immediately ready empty stream (#2092).stream::once(val)
returns a stream that yields a single value: val
(#2094).stream::pending()
returns a stream that never becomes ready (#2092).StreamExt::chain()
sequences a second stream after the first completes (#2093).StreamExt::collect()
transform a stream into a collection (#2109).StreamExt::fuse
ends the stream after the first None
(#2085).StreamExt::merge
combines two streams, yielding values as they become ready (#2091).AsyncSeek
impl for File
(#1986).threaded_scheduler
(#2074, #2082).JoinHandle
(#2044).tokio-macros
.basic_scheduler
Runtime.spawn_blocking
from within a spawn_blocking
(#2006).Runtime
instance in a thread-local (#2011).Waker::will_wake
to return true when tasks match (#2045).time::advance
runs pending tasks before changing the time (#2059).net::lookup_host
maps a T: ToSocketAddrs
to a stream of SocketAddrs
(#1870).process::Child
fields are made public to match std
(#2014).Stream
for sync::broadcast::Receiver
(#2012).sync::RwLock
provides an asynchonous read-write lock (#1699).runtime::Handle::current
returns the handle for the current runtime (#2040).StreamExt::filter
filters stream values according to a predicate (#2001).StreamExt::filter_map
simultaneously filter and map stream values (#2001).StreamExt::try_next
convenience for streams of Result<T, E>
(#2005).StreamExt::take
limits a stream to a specified number of values (#2025).StreamExt::take_while
limits a stream based on a predicate (#2029).StreamExt::all
tests if every element of the stream matches a predicate (#2035).StreamExt::any
tests if any element of the stream matches a predicate (#2034).task::LocalSet.await
runs spawned tasks until the set is idle (#1971).time::DelayQueue::len
returns the number entries in the queue (#1755).#[tokio::main]
and #[tokio::test]
(#2022).fs::File::seek
API regression (#1991).io::AsyncSeek
trait (#1924).Mutex::try_lock
(#1939)mpsc::Receiver::try_recv
and mpsc::UnboundedReceiver::try_recv
(#1939).writev
support for TcpStream
(#1956).time::throttle
for throttling streams (#1949).Stream
for time::DelayQueue
(#1975).sync::broadcast
provides a fan-out channel (#1943).sync::Semaphore
provides an async semaphore (#1973).stream::StreamExt
provides stream utilities (#1962).sync::MutexGuard
debug output (#1961).runtime::Builder::core_threads
and runtime::Builder::max_threads
. runtime::Builder::num_threads
is deprecated (#1977).sync::Mutex
deadlock when lock()
future is dropped early (#1898).AsyncReadExt
and AsyncWriteExt
(#1863).read_buf
/ write_buf
for reading / writing Buf
/ BufMut
(#1881).TcpStream::poll_peek
- pollable API for performing TCP peek (#1864).sync::oneshot::error::TryRecvError
provides variants to detect the error kind (#1874).LocalSet::block_on
accepts !'static
task (#1882).task::JoinError
is now Sync
(#1888).tokio::time::Instant
and std::time::Instant
(#1904).spawn_blocking
after runtime shutdown (#1875).LocalSet
drop inifinite loop (#1892).LocalSet
hang under load (#1905).basic_scheduler
(#1861).spawn
panic message to specify that a task scheduler is required (#1839).runtime::Builder
to include a task scheduler (#1841).LocalSet
(#1843).Builder::{basic, threaded}_scheduler
(#1858).Stream
for signal::unix::Signal
(#1849).signal::ctrl_c
and signal::unix::Signal
(#1854).signal::unix::Signal::{recv, poll_recv}
and signal::windows::CtrlBreak::{recv, poll_recv}
(#1854).File::into_std
and File::try_into_std
methods (#1856).TcpListener::incoming
, UnixListener::incoming
(#1831).tokio::task::LocalSet
provides a strategy for spawning !Send
tasks (#1733).tokio::time::Elapsed
(#1826).AsRawFd
, AsRawHandle
for tokio::fs::File
(#1827).A major breaking change. Most implementation and APIs have changed one way or another. This changelog entry contains a highlight
async / await
.tokio-*
crates are collapsed into this crate.tokio::spawn
returns a JoinHandle
.bytes
0.5tokio::codec
is moved to tokio-util
.timer
and net
drivers are removed, use Runtime
insteadcurrent_thread
runtime is removed, use tokio::runtime::Runtime
with basic_scheduler
instead.tokio-trace-core
version to 0.2 (#1111).tokio::runtime::Builder::panic_handler
allows configuring handling panics on the runtime (#1055).tokio::sync::Mutex
primitive (#964).TypedExecutor
re-export and implementations (#993).sync::Watch
, a single value broadcast channel (#922).std
(#896).UnixDatagram
and UnixDatagramFramed
(#772).Runtime::reactor()
when no tasks are spawned (#721).runtime::Builder
no longer uses deprecated methods (#749).after_start
and before_stop
configuration settings for Runtime
(#756).keep_alive
on runtime builder (#676).LengthDelimitedCodec
(#682).tokio_io::io::read
function (#689).tokio-async-await
dependency (#675).TaskExecutor
from tokio-current-thread
(#652).Runtime
builder API (#645).tokio::run
panics when called from the context of an executor (#646).StreamExt
with a timeout
helper (#573).length_delimited
into tokio
(#575).tokio::net
module (#548).tokio-current-thread::spawn
in current_thread runtime (#579).Runtime::block_on
(#398)runtime::current_thread::block_on_all
(#477)std::error::Error
for error types (#501)Runtime::block_on
for concurrent runtime (#391).current_thread::Runtime
that allows spawning tasks from other threads (#340).clock::now()
, a configurable source of time (#381).CurrentThread
: Expose inner Park
instance.CurrentThread
executor (#313).CurrentThread::turn
to block on idle (#212).CurrentThread
for more flexible usage of current thread executor (#141).