This release marks the beginning of stabilization for runtime metrics. It
stabilizes RuntimeMetrics::worker_count
. Future releases will continue to
stabilize more metrics.
- fs: add
File::create_new
(#6573) - io: add
copy_bidirectional_with_sizes
(#6500) - io: implement
AsyncBufRead
forJoin
(#6449) - net: add Apple visionOS support (#6465)
- net: implement
Clone
forNamedPipeInfo
(#6586) - net: support QNX OS (#6421)
- sync: add
Notify::notify_last
(#6520) - sync: add
mpsc::Receiver::{capacity,max_capacity}
(#6511) - sync: add
split
method to the semaphore permit (#6472, #6478) - task: add
tokio::task::join_set::Builder::spawn_blocking
(#6578) - wasm: support rt-multi-thread with wasm32-wasi-preview1-threads (#6510)
- macros: make
#[tokio::test]
append#[test]
at the end of the attribute list (#6497) - metrics: fix
blocking_threads
count (#6551) - metrics: stabilize
RuntimeMetrics::worker_count
(#6556) - runtime: move task out of the
lifo_slot
inblock_in_place
(#6596) - runtime: panic if
global_queue_interval
is zero (#6445) - sync: always drop message in destructor for oneshot receiver (#6558)
- sync: instrument
Semaphore
for task dumps (#6499) - sync: use FIFO ordering when waking batches of wakers (#6521)
- task: make
LocalKey::get
work with Clone types (#6433) - tests: update nix and mio-aio dev-dependencies (#6552)
- time: clean up implementation (#6517)
- time: lazily init timers on first poll (#6512)
- time: remove the
true_when
field inTimerShared
(#6563) - time: use sharding for timer implementation (#6534)
- taskdump: allow building taskdump docs on non-unix machines (#6564)
- time: check for overflow in
Interval::poll_tick
(#6487) - sync: fix incorrect
is_empty
on mpsc block boundaries (#6603)
- fs: rewrite file system docs (#6467)
- io: fix
stdin
documentation (#6581) - io: fix obsolete reference in
ReadHalf::unsplit()
documentation (#6498) - macros: render more comprehensible documentation for
select!
(#6468) - net: add missing types to module docs (#6482)
- net: fix misleading
NamedPipeServer
example (#6590) - sync: add examples for
SemaphorePermit
,OwnedSemaphorePermit
(#6477) - sync: document that
Barrier::wait
is not cancel safe (#6494) - sync: explain relation between
watch::Sender::{subscribe,closed}
(#6490) - task: clarify that you can't abort
spawn_blocking
tasks (#6571) - task: fix a typo in doc of
LocalSet::run_until
(#6599) - time: fix test-util requirement for pause and resume in docs (#6503)
- fs: add
set_max_buf_size
totokio::fs::File
(#6411) - io: add
try_new
andtry_with_interest
toAsyncFd
(#6345) - sync: add
forget_permits
method to semaphore (#6331) - sync: add
is_closed
,is_empty
, andlen
to mpsc receivers (#6348) - sync: add a
rwlock()
method to ownedRwLock
guards (#6418) - sync: expose strong and weak counts of mpsc sender handles (#6405)
- sync: implement
Clone
forwatch::Sender
(#6388) - task: add
TaskLocalFuture::take_value
(#6340) - task: implement
FromIterator
forJoinSet
(#6300)
- io: make
io::split
use a mutex instead of a spinlock (#6403)
- docs: fix docsrs build without net feature (#6360)
- macros: allow select with only else branch (#6339)
- runtime: fix leaking registration entries when os registration fails (#6329)
- io: document cancel safety of
AsyncBufReadExt::fill_buf
(#6431) - io: document cancel safety of
AsyncReadExt
's primitive read functions (#6337) - runtime: add doc link from
Runtime
to#[tokio::main]
(#6366) - runtime: make the
enter
example deterministic (#6351) - sync: add Semaphore example for limiting the number of outgoing requests (#6419)
- sync: fix missing period in broadcast docs (#6377)
- sync: mark
mpsc::Sender::downgrade
with#[must_use]
(#6326) - sync: reorder
const_new
beforenew_with
(#6392) - sync: update watch channel docs (#6395)
- task: fix documentation links (#6336)
- runtime: include task
Id
in taskdumps (#6328) - runtime: panic if
unhandled_panic
is enabled when not supported (#6410)
- io: add
tokio::io::Join
(#6220) - io: implement
AsyncWrite
forEmpty
(#6235) - net: add support for anonymous unix pipes (#6127)
- net: add
UnixSocket
(#6290) - net: expose keepalive option on
TcpSocket
(#6311) - sync: add
{Receiver,UnboundedReceiver}::poll_recv_many
(#6236) - sync: add
Sender::{try_,}reserve_many
(#6205) - sync: add
watch::Receiver::mark_unchanged
(#6252) - task: add
JoinSet::try_join_next
(#6280)
- io: make
copy
cooperative (#6265) - io: make
repeat
andsink
cooperative (#6254) - io: simplify check for empty slice (#6293)
- process: use pidfd on Linux when available (#6152)
- sync: use AtomicBool in broadcast channel future (#6298)
- io: clarify
clear_ready
docs (#6304) - net: document that
*Fd
traits onTcpSocket
are unix-only (#6294) - sync: document FIFO behavior of
tokio::sync::Mutex
(#6279) - chore: typographic improvements (#6262)
- runtime: remove obsolete comment (#6303)
- task: fix typo (#6261)
This is a forward part of a change that was backported to 1.25.3.
- io: add budgeting to
tokio::runtime::io::registration::async_io
(#6221)
- net: add Apple watchOS support (#6176)
- io: drop the
Sized
requirements fromAsyncReadExt.read_buf
(#6169) - runtime: make
Runtime
unwind safe (#6189) - runtime: reduce the lock contention in task spawn (#6001)
- tokio: update nix dependency to 0.27.1 (#6190)
- chore: make
--cfg docsrs
work without net feature (#6166) - chore: use relaxed load for
unsync_load
on miri (#6179) - runtime: handle missing context on wake (#6148)
- taskdump: fix taskdump cargo config example (#6150)
- taskdump: skip notified tasks during taskdumps (#6194)
- tracing: avoid creating resource spans with current parent, use a None parent instead (#6107)
- tracing: make task span explicit root (#6158)
- io: flush in
AsyncWriteExt
examples (#6149) - runtime: document fairness guarantees and current behavior (#6145)
- task: document cancel safety of
LocalSet::run_until
(#6147)
- io: allow
clear_readiness
after io driver shutdown (#6067) - io: fix integer overflow in
take
(#6080) - io: fix I/O resource hang (#6134)
- sync: fix
broadcast::channel
link (#6100)
- macros: use
::core
qualified imports instead of::std
insidetokio::test
macro (#5973)
- fs: update cfg attr in
fs::read_dir
to includeaix
(#6075) - sync: add
mpsc::Receiver::recv_many
(#6010) - tokio: added vita target support (#6094)
- io: mark
Interest::add
with#[must_use]
(#6037) - runtime: fix cache line size for RISC-V (#5994)
- sync: prevent lock poisoning in
watch::Receiver::wait_for
(#6021) - task: fix
spawn_local
source location (#5984)
- sync: use Acquire/Release orderings instead of SeqCst in
watch
(#6018)
- fs: add vectored writes to
tokio::fs::File
(#5958) - io: add
Interest::remove
method (#5906) - io: add vectored writes to
DuplexStream
(#5985) - net: add Apple tvOS support (#6045)
- sync: add
?Sized
bound to{MutexGuard,OwnedMutexGuard}::map
(#5997) - sync: add
watch::Receiver::mark_unseen
(#5962, #6014, #6017) - sync: add
watch::Sender::new
(#5998) - sync: add const fn
OnceCell::from_value
(#5903)
- remove unused
stats
feature (#5952)
- add missing backticks in code examples (#5938, #6056)
- fix typos (#5988, #6030)
- process: document that
Child::wait
is cancel safe (#5977) - sync: add examples for
Semaphore
(#5939, #5956, #5978, #6031, #6032, #6050) - sync: document that
broadcast
capacity is a lower bound (#6042) - sync: document that
const_new
is not instrumented (#6002) - sync: improve cancel-safety documentation for
mpsc::Sender::send
(#5947) - sync: improve docs for
watch
channel (#5954) - taskdump: render taskdump documentation on docs.rs (#5972)
- taskdump: fix potential deadlock (#6036)
This is a forward part of a change that was backported to 1.25.3.
- io: add budgeting to
tokio::runtime::io::registration::async_io
(#6221)
- sync: fix potential quadratic behavior in
broadcast::Receiver
(#5925)
- rt(alt): improve scalability of alt runtime as the number of cores grows (#5935)
- io: delegate
WriteHalf::poll_write_vectored
(#5914)
- rt(alt): fix memory leak in unstable next-gen scheduler prototype (#5911)
- rt: expose mean task poll time metric (#5927)
This release bumps the MSRV of Tokio to 1.63. (#5887)
- tokio: reduce LLVM code generation (#5859)
- io: support
--cfg mio_unsupported_force_poll_poll
flag (#5881) - sync: make
const_new
methods always available (#5885) - sync: avoid false sharing in mpsc channel (#5829)
- rt: pop at least one task from inject queue (#5908)
- sync: add
broadcast::Sender::new
(#5824) - net: implement
UCred
for espidf (#5868) - fs: add
File::options()
(#5869) - time: implement extra reset variants for
Interval
(#5878) - process: add
{ChildStd*}::into_owned_{fd, handle}
(#5899)
- sync: mention lagging in docs for
broadcast::send
(#5820) - runtime: expand on sharing runtime docs (#5858)
- io: use vec in example for
AsyncReadExt::read_exact
(#5863) - time: mark
Sleep
as!Unpin
in docs (#5916) - process: fix
raw_arg
not showing up in docs (#5865)
- rt: fix nesting two
block_in_place
with ablock_on
between (#5837)
Technically a breaking change, the Send
implementation is removed from
runtime::EnterGuard
. This change fixes a bug and should not impact most users.
- rt:
EnterGuard
should not beSend
(#5766)
- fs: reduce blocking ops in
fs::read_dir
(#5653) - rt: fix possible starvation (#5686, #5712)
- rt: fix stacked borrows issue in
JoinSet
(#5693) - rt: panic if
EnterGuard
dropped incorrect order (#5772) - time: do not overflow to signal value (#5710)
- fs: wait for in-flight ops before cloning
File
(#5803)
- net: add uds doc alias for unix sockets (#5659)
- rt: add metric for number of tasks (#5628)
- sync: implement more traits for channel errors (#5666)
- net: add nodelay methods on TcpSocket (#5672)
- sync: add
broadcast::Receiver::blocking_recv
(#5690) - process: add
raw_arg
method toCommand
(#5704) - io: support PRIORITY epoll events (#5566)
- task: add
JoinSet::poll_join_next
(#5721) - net: add support for Redox OS (#5790)
- rt: add the ability to dump task backtraces (#5608, #5676, #5708, #5717)
- rt: instrument task poll times with a histogram (#5685)
Forward ports 1.18.6 changes.
- deps: disable default features for mio (#5728)
This release fixes a mistake in the build script that makes AsFd
implementations unavailable on Rust 1.63. (#5677)
- io: add
AsyncFd::async_io
(#5542) - io: impl BufMut for ReadBuf (#5590)
- net: add
recv_buf
forUdpSocket
andUnixDatagram
(#5583) - sync: add
OwnedSemaphorePermit::semaphore
(#5618) - sync: add
same_channel
to broadcast channel (#5607) - sync: add
watch::Receiver::wait_for
(#5611) - task: add
JoinSet::spawn_blocking
andJoinSet::spawn_blocking_on
(#5612)
- deps: update windows-sys to 0.48 (#5591)
- io: make
read_to_end
not grow unnecessarily (#5610) - macros: make entrypoints more efficient (#5621)
- sync: improve Debug impl for
RwLock
(#5647) - sync: reduce contention in
Notify
(#5503)
- net: support
get_peer_cred
on AIX (#5065) - sync: avoid deadlocks in
broadcast
with custom wakers (#5578)
- sync: fix typo in
Semaphore::MAX_PERMITS
(#5645) - sync: fix typo in
tokio::sync::watch::Sender
docs (#5587)
This release bumps the MSRV of Tokio to 1.56. (#5559)
- io: add
async_io
helper method to sockets (#5512) - io: add implementations of
AsFd
/AsHandle
/AsSocket
(#5514, #5540) - net: add
UdpSocket::peek_sender()
(#5520) - sync: add
RwLockWriteGuard::{downgrade_map, try_downgrade_map}
(#5527) - task: add
JoinHandle::abort_handle
(#5543)
- io: use
memchr
fromlibc
(#5558) - macros: accept path as crate rename in
#[tokio::main]
(#5557) - macros: update to syn 2.0.0 (#5572)
- time: don't register for a wakeup when
Interval
returnsReady
(#5553)
- fs: fuse std iterator in
ReadDir
(#5555) - tracing: fix
spawn_blocking
location fields (#5573) - time: clean up redundant check in
Wheel::poll()
(#5574)
- macros: define cancellation safety (#5525)
- io: add details to docs of
tokio::io::copy[_buf]
(#5575) - io: refer to
ReaderStream
andStreamReader
in module docs (#5576)
- macros: fix empty
join!
andtry_join!
(#5504) - sync: don't leak tracing spans in mutex guards (#5469)
- sync: drop wakers after unlocking the mutex in Notify (#5471)
- sync: drop wakers outside lock in semaphore (#5475)
- fs: add
fs::try_exists
(#4299) - net: add types for named unix pipes (#5351)
- sync: add
MappedOwnedMutexGuard
(#5474)
- chore: update windows-sys to 0.45 (#5386)
- net: use Message Read Mode for named pipes (#5350)
- sync: mark lock guards with
#[clippy::has_significant_drop]
(#5422) - sync: reduce contention in watch channel (#5464)
- time: remove cache padding in timer entries (#5468)
- time: Improve
Instant::now()
perf with test-util (#5513)
- io: use
poll_fn
incopy_bidirectional
(#5486) - net: refactor named pipe builders to not use bitfields (#5477)
- rt: remove Arc from Clock (#5434)
- sync: make
notify_waiters
calls atomic (#5458) - time: don't store deadline twice in sleep entries (#5410)
- metrics: add a new metric for budget exhaustion yields (#5517)
- io: improve AsyncFd example (#5481)
- runtime: document the nature of the main future (#5494)
- runtime: remove extra period in docs (#5511)
- signal: updated Documentation for Signals (#5459)
- sync: add doc aliases for
blocking_*
methods (#5448) - sync: fix docs for Send/Sync bounds in broadcast (#5480)
- sync: document drop behavior for channels (#5497)
- task: clarify what happens to spawned work during runtime shutdown (#5394)
- task: clarify
process::Command
docs (#5413) - task: fix wording with 'unsend' (#5452)
- time: document immediate completion guarantee for timeouts (#5509)
- tokio: document supported platforms (#5483)
- io: add budgeting to
tokio::runtime::io::registration::async_io
(#6221)
Forward ports 1.20.6 changes.
- io: use
memchr
fromlibc
(#5960)
Forward ports 1.18.6 changes.
- deps: disable default features for mio (#5728)
- rt: fix runtime metrics reporting (#5330)
- sync: add
broadcast::Sender::len
(#5343)
- fs: increase maximum read buffer size to 2MiB (#5397)
Forward ports 1.18.5 changes.
- io: fix unsoundness in
ReadHalf::unsplit
(#5375)
This release fixes a compilation failure on targets without AtomicU64
when using rustc older than 1.63. (#5356)
- rt: improve native
AtomicU64
support detection (#5284)
- rt: add configuration option for max number of I/O events polled from the OS per tick (#5186)
- rt: add an environment variable for configuring the default number of worker threads per runtime instance (#4250)
- sync: reduce MPSC channel stack usage (#5294)
- io: reduce lock contention in I/O operations (#5300)
- fs: speed up
read_dir()
by chunking operations (#5309) - rt: use internal
ThreadId
implementation (#5329) - test: don't auto-advance time when a
spawn_blocking
task is running (#5115)
This release forward ports changes from 1.18.4.
- net: fix Windows named pipe server builder to maintain option when toggling pipe mode (#5336).
- net: fix Windows named pipe connect (#5208)
- io: support vectored writes for
ChildStdin
(#5216) - io: fix
async fn ready()
false positive for OS-specific events (#5231)
- runtime:
yield_now
defers task until after driver poll (#5223) - runtime: reduce amount of codegen needed per spawned task (#5213)
- windows: replace
winapi
dependency withwindows-sys
(#5204)
- runtime: add
Handle::runtime_flavor
(#5138) - sync: add
Mutex::blocking_lock_owned
(#5130) - sync: add
Semaphore::MAX_PERMITS
(#5144) - sync: add
merge()
to semaphore permits (#4948) - sync: add
mpsc::WeakUnboundedSender
(#5189)
- process: add
Command::process_group
(#5114) - runtime: export metrics about the blocking thread pool (#5161)
- task: add
task::id()
andtask::try_id()
(#5171)
- macros: don't take ownership of futures in macros (#5087)
- runtime: fix Stacked Borrows violation in
LocalOwnedTasks
(#5099) - runtime: mitigate ABA with 32-bit queue indices when possible (#5042)
- task: wake local tasks to the local queue when woken by the same thread (#5095)
- time: panic in release mode when
mark_pending
called illegally (#5093) - runtime: fix typo in expect message (#5169)
- runtime: fix
unsync_load
on atomic types (#5175) - task: elaborate safety comments in task deallocation (#5172)
- runtime: fix
LocalSet
drop in thread local (#5179) - net: remove libc type leakage in a public API (#5191)
- runtime: update the alignment of
CachePadded
(#5106)
- io: make
tokio::io::copy
continue filling the buffer when writer stalls (#5066) - runtime: remove
coop::budget
fromLocalSet::run_until
(#5155) - sync: make
Notify
panic safe (#5154)
- io: fix doc for
write_i8
to use signed integers (#5040) - net: fix doc typos for TCP and UDP
set_tos
methods (#5073) - net: fix function name in
UdpSocket::recv
documentation (#5150) - sync: typo in
TryLockError
forRwLock::try_write
(#5160) - task: document that spawned tasks execute immediately (#5117)
- time: document return type of
timeout
(#5118) - time: document that
timeout
checks only before poll (#5126) - sync: specify return type of
oneshot::Receiver
in docs (#5198)
- runtime: use const
Mutex::new
for globals (#5061) - runtime: remove
Option
aroundmio::Events
in io driver (#5078) - runtime: remove a conditional compilation clause (#5104)
- runtime: remove a reference to internal time handle (#5107)
- runtime: misc time driver cleanup (#5120)
- runtime: move signal driver to runtime module (#5121)
- runtime: signal driver now uses I/O driver directly (#5125)
- runtime: start decoupling I/O driver and I/O handle (#5127)
- runtime: switch
io::handle
refs with scheduler:Handle (#5128) - runtime: remove Arc from I/O driver (#5134)
- runtime: use signal driver handle via
scheduler::Handle
(#5135) - runtime: move internal clock fns out of context (#5139)
- runtime: remove
runtime::context
module (#5140) - runtime: keep driver cfgs in
driver.rs
(#5141) - runtime: add
runtime::context
to unify thread-locals (#5143) - runtime: rename some confusing internal variables/fns (#5151)
- runtime: move
coop
mod intoruntime
(#5152) - runtime: move budget state to context thread-local (#5157)
- runtime: move park logic into runtime module (#5158)
- runtime: move
Runtime
into its own file (#5159) - runtime: unify entering a runtime with
Handle::enter
(#5163) - runtime: remove handle reference from each scheduler (#5166)
- runtime: move
enter
intocontext
(#5167) - runtime: combine context and entered thread-locals (#5168)
- runtime: fix accidental unsetting of current handle (#5178)
- runtime: move
CoreStage
methods toCore
(#5182) - sync: name mpsc semaphore types (#5146)
This release removes the dependency on the once_cell
crate to restore the MSRV
of 1.21.x, which is the latest minor version at the time of release. (#5048)
- net: fix dependency resolution for socket2 (#5000)
- task: ignore failure to set TLS in
LocalSet
Drop (#4976)
This release is the first release of Tokio to intentionally support WASM. The
sync,macros,io-util,rt,time
features are stabilized on WASM. Additionally the
wasm32-wasi target is given unstable support for the net
feature.
- net: add
device
andbind_device
methods to TCP/UDP sockets (#4882) - net: add
tos
andset_tos
methods to TCP and UDP sockets (#4877) - net: add security flags to named pipe
ServerOptions
(#4845) - signal: add more windows signal handlers (#4924)
- sync: add
mpsc::Sender::max_capacity
method (#4904) - sync: implement Weak version of
mpsc::Sender
(#4595) - task: add
LocalSet::enter
(#4765) - task: stabilize
JoinSet
andAbortHandle
(#4920) - tokio: add
track_caller
to public APIs (#4805, #4848, #4852) - wasm: initial support for
wasm32-wasi
target (#4716)
- miri: improve miri compatibility by avoiding temporary references in
linked_list::Link
impls (#4841) - signal: don't register write interest on signal pipe (#4898)
- sync: add
#[must_use]
to lock guards (#4886) - sync: fix hang when calling
recv
on closed and reopened broadcast channel (#4867) - task: propagate attributes on task-locals (#4837)
- fs: change panic to error in
File::start_seek
(#4897) - io: reduce syscalls in
poll_read
(#4840) - process: use blocking threadpool for child stdio I/O (#4824)
- signal: make
SignalKind
methods const (#4956)
- rt: extract
basic_scheduler::Config
(#4935) - rt: move I/O driver into
runtime
module (#4942) - rt: rename internal scheduler types (#4945)
- chore: fix typos and grammar (#4858, #4894, #4928)
- io: fix typo in
AsyncSeekExt::rewind
docs (#4893) - net: add documentation to
try_read()
for zero-length buffers (#4937) - runtime: remove incorrect panic section for
Builder::worker_threads
(#4849) - sync: doc of
watch::Sender::send
improved (#4959) - task: add cancel safety docs to
JoinHandle
(#4901) - task: expand on cancellation of
spawn_blocking
(#4811) - time: clarify that the first tick of
Interval::tick
happens immediately (#4951)
- rt: add unstable option to disable the LIFO slot (#4936)
- task: fix incorrect signature in
Builder::spawn_on
(#4953) - task: make
task::Builder::spawn*
methods fallible (#4823)
This is a backport of a change from 1.27.0.
- io: use
memchr
fromlibc
(#5960)
Forward ports 1.18.6 changes.
- deps: disable default features for mio (#5728)
Forward ports 1.18.5 changes.
- io: fix unsoundness in
ReadHalf::unsplit
(#5375)
This release forward ports changes from 1.18.4.
- net: fix Windows named pipe server builder to maintain option when toggling pipe mode (#5336).
This release removes the dependency on the once_cell
crate to restore the MSRV
of the 1.20.x LTS release. (#5048)
- chore: fix version detection in build script (#4860)
- tokio: add
track_caller
to public APIs (#4772, #4791, #4793, #4806, #4808) - sync: Add
has_changed
method towatch::Ref
(#4758)
- time: remove
src/time/driver/wheel/stack.rs
(#4766) - rt: clean up arguments passed to basic scheduler (#4767)
- net: be more specific about winapi features (#4764)
- tokio: use const initialized thread locals where possible (#4677)
- task: various small improvements to LocalKey (#4795)
- fs: warn about performance pitfall (#4762)
- chore: fix spelling (#4769)
- sync: document spurious failures in oneshot (#4777)
- sync: add warning for watch in non-Send futures (#4741)
- chore: fix typo (#4798)
- joinset: rename
join_one
tojoin_next
(#4755) - rt: unhandled panic config for current thread rt (#4770)
This release fixes another bug in Notified::enable
. (#4751)
This release fixes a bug in Notified::enable
. (#4747)
- runtime: add
is_finished
method forJoinHandle
andAbortHandle
(#4709) - runtime: make global queue and event polling intervals configurable (#4671)
- sync: add
Notified::enable
(#4705) - sync: add
watch::Sender::send_if_modified
(#4591) - sync: add resubscribe method to broadcast::Receiver (#4607)
- net: add
take_error
toTcpSocket
andTcpStream
(#4739)
- io: refactor out usage of Weak in the io handle (#4656)
- macros: avoid starvation in
join!
andtry_join!
(#4624)
- runtime: clarify semantics of tasks outliving
block_on
(#4729) - time: fix example for
MissedTickBehavior::Burst
(#4713)
- metrics: correctly update atomics in
IoDriverMetrics
(#4725) - metrics: fix compilation with unstable, process, and rt, but without net (#4682)
- task: add
#[track_caller]
toJoinSet
/JoinMap
(#4697) - task: add
Builder::{spawn_on, spawn_local_on, spawn_blocking_on}
(#4683) - task: add
consume_budget
for cooperative scheduling (#4498) - task: add
join_set::Builder
for configuringJoinSet
tasks (#4687) - task: update return value of
JoinSet::join_one
(#4726)
- deps: disable default features for mio (#5728)
- io: fix unsoundness in
ReadHalf::unsplit
(#5375)
- net: fix Windows named pipe server builder to maintain option when toggling pipe mode (#5336).
This release removes the dependency on the once_cell
crate to restore the MSRV
of the 1.18.x LTS release. (#5048)
Add missing features for the winapi
dependency. (#4663)
The 1.18.0 release broke the build for targets without 64-bit atomics when
building with tokio_unstable
. This release fixes that. (#4649)
This release adds a number of new APIs in tokio::net
, tokio::signal
, and
tokio::sync
. In addition, it adds new unstable APIs to tokio::task
(Id
s
for uniquely identifying a task, and AbortHandle
for remotely cancelling a
task), as well as a number of bugfixes.
- blocking: add missing
#[track_caller]
forspawn_blocking
(#4616) - macros: fix
select
macro to process 64 branches (#4519) - net: fix
try_io
methods not calling Mio'stry_io
internally (#4582) - runtime: recover when OS fails to spawn a new thread (#4485)
- net: add
UdpSocket::peer_addr
(#4611) - net: add
try_read_buf
method for named pipes (#4626) - signal: add
SignalKind
Hash
/Eq
impls andc_int
conversion (#4540) - signal: add support for signals up to
SIGRTMAX
(#4555) - sync: add
watch::Sender::send_modify
method (#4310) - sync: add
broadcast::Receiver::len
method (#4542) - sync: add
watch::Receiver::same_channel
method (#4581) - sync: implement
Clone
forRecvError
types (#4560)
- update
mio
to 0.8.1 (#4582) - macros: rename
tokio::select!
's internalutil
module (#4543) - runtime: use
Vec::with_capacity
when building runtime (#4553)
- improve docs for
tokio_unstable
(#4524) - runtime: include more documentation for thread_pool/worker (#4511)
- runtime: update
Handle::current
's docs to mentionEnterGuard
(#4567) - time: clarify platform specific timer resolution (#4474)
- signal: document that
Signal::recv
is cancel-safe (#4634) - sync:
UnboundedReceiver
close docs (#4548)
The following changes only apply when building with --cfg tokio_unstable
:
- task: add
task::Id
type (#4630) - task: add
AbortHandle
type for cancelling tasks in aJoinSet
(#4530, #4640) - task: fix missing
doc(cfg(...))
attributes forJoinSet
(#4531) - task: fix broken link in
AbortHandle
RustDoc (#4545) - metrics: add initial IO driver metrics (#4507)
This release updates the minimum supported Rust version (MSRV) to 1.49, the
mio
dependency to v0.8, and the (optional) parking_lot
dependency to v0.12.
Additionally, it contains several bug fixes, as well as internal refactoring and
performance improvements.
- time: prevent panicking in
sleep
with large durations (#4495) - time: eliminate potential panics in
Instant
arithmetic on platforms whereInstant::now
is not monotonic (#4461) - io: fix
DuplexStream
not participating in cooperative yielding (#4478) - rt: fix potential double panic when dropping a
JoinHandle
(#4430)
- update minimum supported Rust version to 1.49 (#4457)
- update
parking_lot
dependency to v0.12.0 (#4459) - update
mio
dependency to v0.8 (#4449) - rt: remove an unnecessary lock in the blocking pool (#4436)
- rt: remove an unnecessary enum in the basic scheduler (#4462)
- time: use bit manipulation instead of modulo to improve performance (#4480)
- net: use
std::future::Ready
instead of our ownReady
future (#4271) - replace deprecated
atomic::spin_loop_hint
withhint::spin_loop
(#4491) - fix miri failures in intrusive linked lists (#4397)
- io: add an example for
tokio::process::ChildStdin
(#4479)
The following changes only apply when building with --cfg tokio_unstable
:
- task: fix missing location information in
tracing
spans generated byspawn_local
(#4483) - task: add
JoinSet
for managing sets of tasks (#4335) - metrics: fix compilation error on MIPS (#4475)
- metrics: fix compilation error on arm32v7 (#4453)
This release fixes a bug in #4428 with the change #4437.
Fixes a soundness bug in io::Take
(#4428). The unsoundness is exposed when
leaking memory in the given AsyncRead
implementation and then overwriting the
supplied buffer:
impl AsyncRead for Buggy {
fn poll_read(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
buf: &mut ReadBuf<'_>
) -> Poll<Result<()>> {
let new_buf = vec![0; 5].leak();
*buf = ReadBuf::new(new_buf);
buf.put_slice(b"hello");
Poll::Ready(Ok(()))
}
}
Also, this release includes improvements to the multi-threaded scheduler that can increase throughput by up to 20% in some cases (#4383).
- io: soundness don't expose uninitialized memory when using
io::Take
in edge case (#4428) - fs: ensure
File::write
results in awrite
syscall when the runtime shuts down (#4316) - process: drop pipe after child exits in
wait_with_output
(#4315) - rt: improve error message when spawning a thread fails (#4398)
- rt: reduce false-positive thread wakups in the multi-threaded scheduler (#4383)
- sync: don't inherit
Send
fromparking_lot::*Guard
(#4359)
- net:
TcpSocket::linger()
andset_linger()
(#4324) - net: impl
UnwindSafe
for socket types (#4384) - rt: impl
UnwindSafe
forJoinHandle
(#4418) - sync:
watch::Receiver::has_changed()
(#4342) - sync:
oneshot::Receiver::blocking_recv()
(#4334) - sync:
RwLock
blocking operations (#4425)
The following changes only apply when building with --cfg tokio_unstable
- rt: breaking change overhaul runtime metrics API (#4373)
- io: add cooperative yielding support to
io::empty()
(#4300) - time: make timeout robust against budget-depleting tasks (#4314)
- update minimum supported Rust version to 1.46.
- time: add
Interval::reset()
(#4248) - io: add explicit lifetimes to
AsyncFdReadyGuard
(#4267) - process: add
Command::as_std()
(#4295)
- tracing: instrument
tokio::sync
types (#4302)
- macros: fix compiler errors when using
mut
patterns inselect!
(#4211) - sync: fix a data race between
oneshot::Sender::send
and awaiting aoneshot::Receiver
when the oneshot has been closed (#4226) - sync: make
AtomicWaker
panic safe (#3689) - runtime: fix basic scheduler dropping tasks outside a runtime context (#4213)
- io: updated
copy
buffer size to matchstd::io::copy
(#4209)
- sync: fix a data race between
oneshot::Sender::send
and awaiting aoneshot::Receiver
when the oneshot has been closed (#4226)
- sync: fix
Notify
to clone the waker before locking its waiter list (#4129) - tokio: add riscv32 to non atomic64 architectures (#4185)
- net: add
poll_{recv,send}_ready
methods toudp
anduds_datagram
(#4131) - net: add
try_*
,readable
,writable
,ready
, andpeer_addr
methods to split halves (#4120) - sync: add
blocking_lock
toMutex
(#4130) - sync: add
watch::Sender::send_replace
(#3962, #4195) - sync: expand
Debug
forMutex<T>
impl to unsizedT
(#4134) - tracing: instrument time::Sleep (#4072)
- tracing: use structured location fields for spawned tasks (#4128)
- io: add assert in
copy_bidirectional
thatpoll_write
is sensible (#4125) - macros: use qualified syntax when polling in
select!
(#4192) - runtime: handle
block_on
wakeups better (#4157) - task: allocate callback on heap immediately in debug mode (#4203)
- tokio: assert platform-minimum requirements at build time (#3797)
- docs: conversion of doc comments to indicative mood (#4174)
- docs: add returning on the first error example for
try_join!
(#4133) - docs: fixing broken links in
tokio/src/lib.rs
(#4132) - signal: add example with background listener (#4171)
- sync: add more oneshot examples (#4153)
- time: document
Interval::tick
cancel safety (#4152)
- mpsc: ensure
try_reserve
error is consistent withtry_send
(#4119) - mpsc: use
spin_loop_hint
instead ofyield_now
(#4115) - sync: make
SendError
field public (#4097)
- io: add POSIX AIO on FreeBSD (#4054)
- io: add convenience method
AsyncSeekExt::rewind
(#4107) - runtime: add tracing span for
block_on
futures (#4094) - runtime: callback when a worker parks and unparks (#4070)
- sync: implement
try_recv
for mpsc channels (#4113)
- docs: clarify CPU-bound tasks on Tokio (#4105)
- mpsc: document spurious failures on
poll_recv
(#4117) - mpsc: document that
PollSender
implsSink
(#4110) - task: document non-guarantees of
yield_now
(#4091) - time: document paused time details better (#4061, #4103)
- time: don't panic when Instant is not monotonic (#4044)
- io: fix panic in
fill_buf
by not callingpoll_fill_buf
twice (#4084)
- watch: add
watch::Sender::subscribe
(#3800) - process: add
from_std
toChildStd*
(#4045) - stats: initial work on runtime stats (#4043)
- tracing: change span naming to new console convention (#4042)
- io: speed-up waking by using uninitialized array (#4055, #4071, #4075)
- time: make Sleep examples easier to find (#4040)
- runtime: fix leak in UnownedTask (#4063)
- io: add
(read|write)_f(32|64)[_le]
methods (#4022) - io: add
fill_buf
andconsume
toAsyncBufReadExt
(#3991) - process: add
Child::raw_handle()
on windows (#3998)
- doc: fix non-doc builds with
--cfg docsrs
(#4020) - io: flush eagerly in
io::copy
(#4001) - runtime: a debug assert was sometimes triggered during shutdown (#4005)
- sync: use
spin_loop_hint
instead ofyield_now
in mpsc (#4037) - tokio: the test-util feature depends on rt, sync, and time (#4036)
- runtime: reorganize parts of the runtime (#3979, #4005)
- signal: make windows docs for signal module show up on unix builds (#3770)
- task: quickly send task to heap on debug mode (#4009)
- io: document cancellation safety of
AsyncBufReadExt
(#3997) - sync: document when
watch::send
fails (#4021)
- net: allow customized I/O operations for
TcpStream
(#3888) - sync: add getter for the mutex from a guard (#3928)
- task: expose nameable future for
TaskLocal::scope
(#3273)
- runtime: reorganize parts of the runtime (#3909, #3939, #3950, #3955, #3980)
- sync: clean up
OnceCell
(#3945) - task: remove mutex in
JoinError
(#3959)
This release backports two fixes from 1.9.0
Fixes a missed edge case from 1.8.1.
- runtime: drop canceled future on next poll (#3965)
Forward ports 1.5.1 fixes.
- runtime: remotely abort tasks on
JoinHandle::abort
(#3934)
- io: add
get_{ref,mut}
methods toAsyncFdReadyGuard
andAsyncFdReadyMutGuard
(#3807) - io: efficient implementation of vectored writes for
BufWriter
(#3163) - net: add ready/try methods to
NamedPipe{Client,Server}
(#3866, #3899) - sync: add
watch::Receiver::borrow_and_update
(#3813) - sync: implement
From<T>
forOnceCell<T>
(#3877) - time: allow users to specify Interval behavior when delayed (#3721)
- rt: add
tokio::task::Builder
(#3881)
- net: handle HUP event with
UnixStream
(#3898)
- doc: document cancellation safety (#3900)
- time: add wait alias to sleep (#3897)
- time: document auto-advancing behavior of runtime (#3763)
Forward ports 1.5.1 fixes.
- runtime: remotely abort tasks on
JoinHandle::abort
(#3934)
- runtime: fix early task shutdown during runtime shutdown (#3870)
- net: add named pipes on windows (#3760)
- net: add
TcpSocket
fromstd::net::TcpStream
conversion (#3838) - sync: add
receiver_count
towatch::Sender
(#3729) - sync: export
sync::notify::Notified
future publicly (#3840) - tracing: instrument task wakers (#3836)
- macros: suppress
clippy::default_numeric_fallback
lint in generated code (#3831) - runtime: immediately drop new tasks when runtime is shut down (#3752)
- sync: deprecate unused
mpsc::RecvError
type (#3833)
- io: clarify EOF condition for
AsyncReadExt::read_buf
(#3850) - io: clarify limits on return values of
AsyncWrite::poll_write
(#3820) - sync: add examples to Semaphore (#3808)
Forward ports 1.5.1 fixes.
- runtime: remotely abort tasks on
JoinHandle::abort
(#3934)
- test: sub-ms
time:advance
regression introduced in 1.6 (#3852)
This release reverts #3518 because it doesn't work on some kernels due to a kernel bug. (#3803)
- fs: try doing a non-blocking read before punting to the threadpool (#3518)
- io: add
write_all_buf
toAsyncWriteExt
(#3737) - io: implement
AsyncSeek
forBufReader
,BufWriter
, andBufStream
(#3491) - net: support non-blocking vectored I/O (#3761)
- sync: add
mpsc::Sender::{reserve_owned, try_reserve_owned}
(#3704) - sync: add a
MutexGuard::map
method that returns aMappedMutexGuard
(#2472) - time: add getter for Interval's period (#3705)
- io: wake pending writers on
DuplexStream
close (#3756) - process: avoid redundant effort to reap orphan processes (#3743)
- signal: use
std::os::raw::c_int
instead oflibc::c_int
on public API (#3774) - sync: preserve permit state in
notify_waiters
(#3660) - task: update
JoinHandle
panic message (#3727) - time: prevent
time::advance
from going too far (#3712)
- net: hide
net::unix::datagram
module from docs (#3775) - process: updated example (#3748)
- sync:
Barrier
doc should use task, not thread (#3780) - task: update documentation on
block_in_place
(#3753)
- runtime: remotely abort tasks on
JoinHandle::abort
(#3934)
- io: add
AsyncSeekExt::stream_position
(#3650) - io: add
AsyncWriteExt::write_vectored
(#3678) - io: add a
copy_bidirectional
utility (#3572) - net: implement
IntoRawFd
forTcpSocket
(#3684) - sync: add
OnceCell
(#3591) - sync: add
OwnedRwLockReadGuard
andOwnedRwLockWriteGuard
(#3340) - sync: add
Semaphore::is_closed
(#3673) - sync: add
mpsc::Sender::capacity
(#3690) - sync: allow configuring
RwLock
max reads (#3644) - task: add
sync_scope
forLocalKey
(#3612)
- chore: try to avoid
noalias
attributes on intrusive linked list (#3654) - rt: fix panic in
JoinHandle::abort()
when called from other threads (#3672) - sync: don't panic in
oneshot::try_recv
(#3674) - sync: fix notifications getting dropped on receiver drop (#3652)
- sync: fix
Semaphore
permit overflow calculation (#3644)
- io: clarify requirements of
AsyncFd
(#3635) - runtime: fix unclear docs for
{Handle,Runtime}::block_on
(#3628) - sync: document that
Semaphore
is fair (#3693) - sync: improve doc on blocking mutex (#3645)
- runtime: avoid unnecessary polling of
block_on
future (#3582) - runtime: fix memory leak/growth when creating many runtimes (#3564)
- runtime: mark
EnterGuard
withmust_use
(#3609)
- chore: mention fix for building docs in contributing guide (#3618)
- doc: add link to
PollSender
(#3613) - doc: alias sleep to delay (#3604)
- sync: improve
Mutex
FIFO explanation (#3615) - timer: fix double newline in module docs (#3617)
- coop: expose an
unconstrained()
opt-out (#3547) - net: add
into_std
for net types without it (#3509) - sync: add
same_channel
method tompsc::Sender
(#3532) - sync: add
{try_,}acquire_many_owned
toSemaphore
(#3535) - sync: add back
RwLockWriteGuard::map
andRwLockWriteGuard::try_map
(#3348)
- sync: allow
oneshot::Receiver::close
after successfultry_recv
(#3552) - time: do not panic on
timeout(Duration::MAX)
(#3551)
- doc: doc aliases for pre-1.0 function names (#3523)
- io: fix typos (#3541)
- io: note the EOF behavior of
read_until
(#3536) - io: update
AsyncRead::poll_read
doc (#3557) - net: update
UdpSocket
splitting doc (#3517) - runtime: add link to
LocalSet
onnew_current_thread
(#3508) - runtime: update documentation of thread limits (#3527)
- sync: do not recommend
join_all
forBarrier
(#3514) - sync: documentation for
oneshot
(#3592) - sync: rename
notify
tonotify_one
(#3526) - time: fix typo in
Sleep
doc (#3515) - time: sync
interval.rs
andtime/mod.rs
docs (#3533)
- signal: make
Signal::poll_recv
method public (#3383)
- time: make
test-util
paused time fully deterministic (#3492)
- sync: link to new broadcast and watch wrappers (#3504)
Forward ports 1.0.3 fix.
- io: memory leak during shutdown (#3477).
- net: add
try_read_buf
andtry_recv_buf
(#3351) - mpsc: Add
Sender::try_reserve
function (#3418) - sync: add
RwLock
try_read
andtry_write
methods (#3400) - io: add
ReadBuf::inner_mut
(#3443)
- macros: improve
select!
error message (#3352) - io: keep track of initialized bytes in
read_to_end
(#3426) - runtime: consolidate errors for context missing (#3441)
- stream: link to new
Stream
wrappers intokio-stream
(#3343) - docs: mention that
test-util
feature is not enabled with full (#3397) - process: add documentation to process::Child fields (#3437)
- io: clarify
AsyncFd
docs about changes of the inner fd (#3430) - net: update datagram docs on splitting (#3448)
- time: document that
Sleep
is notUnpin
(#3457) - sync: add link to
PollSemaphore
(#3456) - task: add
LocalSet
example (#3438) - sync: improve bounded
mpsc
documentation (#3458)
- io: memory leak during shutdown (#3477).
- io: soundness in
read_to_end
(#3428).
This release fixes a soundness hole caused by the combination of RwLockWriteGuard::map
and RwLockWriteGuard::downgrade
by removing the map
function. This is a breaking
change, but breaking changes are allowed under our semver policy when they are required
to fix a soundness hole. (See this RFC for more.)
Note that we have chosen not to do a deprecation cycle or similar because Tokio 1.0.0 was released two days ago, and therefore the impact should be minimal.
Due to the soundness hole, we have also yanked Tokio version 1.0.0.
- sync: remove
RwLockWriteGuard::map
andRwLockWriteGuard::try_map
(#3345)
- docs: remove stream feature from docs (#3335)
Commit to the API and long-term support.
- sync: spurious wakeup in
watch
(#3234).
- io: rename
AsyncFd::with_io()
totry_io()
(#3306) - fs: avoid OS specific
*Ext
traits in favor of conditionally defining the fn (#3264). - fs:
Sleep
is!Unpin
(#3278). - net: pass
SocketAddr
by value (#3125). - net:
TcpStream::poll_peek
takesReadBuf
(#3259). - rt: rename
runtime::Builder::max_threads()
tomax_blocking_threads()
(#3287). - time: require
current_thread
runtime when callingtime::pause()
(#3289).
- remove
tokio::prelude
(#3299). - io: remove
AsyncFd::with_poll()
(#3306). - net: remove
{Tcp,Unix}Stream::shutdown()
in favor ofAsyncWrite::shutdown()
(#3298). - stream: move all stream utilities to
tokio-stream
untilStream
is added tostd
(#3277). - sync: mpsc
try_recv()
due to unexpected behavior (#3263). - tracing: make unstable as
tracing-core
is not 1.0 yet (#3266).
- fs:
poll_*
fns toDirEntry
(#3308). - io:
poll_*
fns toio::Lines
,io::Split
(#3308). - io:
_mut
method variants toAsyncFd
(#3304). - net:
poll_*
fns toUnixDatagram
(#3223). - net:
UnixStream
readiness and non-blocking ops (#3246). - sync:
UnboundedReceiver::blocking_recv()
(#3262). - sync:
watch::Sender::borrow()
(#3269). - sync:
Semaphore::close()
(#3065). - sync:
poll_recv
fns tompsc::Receiver
,mpsc::UnboundedReceiver
(#3308). - time:
poll_tick
fn totime::Interval
(#3316).
- rt: fix deadlock in shutdown (#3228)
- rt: fix panic in task abort when off rt (#3159)
- sync: make
add_permits
panic with usize::MAX >> 3 permits (#3188) - time: Fix race condition in timer drop (#3229)
- watch: fix spurious wakeup (#3244)
- stream:
StreamMap
Default
impl bound (#3093). - io:
AsyncFd::into_inner()
should deregister the FD (#3104).
- meta:
parking_lot
feature enabled withfull
(#3119).
- io:
AsyncWrite
vectored writes (#3149). - net: TCP/UDP readiness and non-blocking ops (#3130, #2743, #3138).
- net: TCP socket option (linger, send/recv buf size) (#3145, #3143).
- net: PID field in
UCred
with solaris/illumos (#3085). - rt:
runtime::Handle
allows spawning onto a runtime (#3079). - sync:
Notify::notify_waiters()
(#3098). - sync:
acquire_many()
,try_acquire_many()
toSemaphore
(#3067).
Fixes a soundness hole by adding a missing Send
bound to
Runtime::spawn_blocking()
.
- rt: include missing
Send
, fixing soundness hole (#3089). - tracing: avoid huge trace span names (#3074).
- net:
TcpSocket::reuseport()
,TcpSocket::set_reuseport()
(#3083). - net:
TcpSocket::reuseaddr()
(#3093). - net:
TcpSocket::local_addr()
(#3093). - net: add pid to
UCred
(#2633).
Adds AsyncFd
as a replacement for v0.2's PollEvented
.
- io: fix a potential deadlock when shutting down the I/O driver (#2903).
- sync:
RwLockWriteGuard::downgrade()
bug (#2957).
- io:
AsyncFd
for receiving readiness events on raw FDs (#2903). - net:
poll_*
function onUdpSocket
(#2981). - net:
UdpSocket::take_error()
(#3051). - sync:
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.
- io:
copy_buf()
(#2884). - io:
AsyncReadExt::read_buf()
,AsyncReadExt::write_buf()
for working withBuf
/BufMut
(#3003). - rt:
Runtime::spawn_blocking()
(#2980). - sync:
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:
- I/O driver internal rewrite. The windows implementation includes significant changes.
- Runtime API is polished, especially with how it interacts with feature flag combinations.
- Feature flags are simplified
rt-core
andrt-util
are combined tort
rt-threaded
is renamed tort-multi-thread
to match builder APItcp
,udp
,uds
,dns
are combined tonet
.parking_lot
is included withfull
- meta: Minimum supported Rust version is now 1.45.
- io:
AsyncRead
trait now takesReadBuf
in order to safely handle reading into uninitialized memory (#2758). - io: Internal I/O driver storage is now able to compact (#2757).
- rt:
Runtime::block_on
now takes&self
(#2782). - sync:
watch
reworked to decouple receiving a change notification from receiving the value (#2814, #2806). - sync:
Notify::notify
is renamed tonotify_one
(#2822). - process:
Child::kill
is now anasync fn
that cleans zombies (#2823). - sync: use
const fn
constructors as possible (#2833, #2790) - signal: reduce cross-thread notification (#2835).
- net: tcp,udp,uds types support operations with
&self
(#2828, #2919, #2934). - sync: blocking
mpsc
channel supportssend
with&self
(#2861). - time: rename
delay_for
anddelay_until
tosleep
andsleep_until
(#2826). - io: upgrade to
mio
0.7 (#2893). - io:
AsyncSeek
trait is tweaked (#2885). - fs:
File
operations take&self
(#2930). - rt: runtime API, and
#[tokio::main]
macro polish (#2876) - rt:
Runtime::enter
uses an RAII guard instead of a closure (#2954). - net: the
from_std
function on all sockets no longer sets socket into non-blocking mode (#2893)
- sync:
map
function to lock guards (#2445). - sync:
blocking_recv
andblocking_send
fns tompsc
for use outside of Tokio (#2685). - rt:
Builder::thread_name_fn
for configuring thread names (#1921). - fs: impl
FromRawFd
andFromRawHandle
forFile
(#2792). - process:
Child::wait
andChild::try_wait
(#2796). - rt: support configuring thread keep-alive duration (#2809).
- rt:
task::JoinHandle::abort
forcibly cancels a spawned task (#2474). - sync:
RwLock
write guard to read guard downgrading (#2733). - net: add
poll_*
functions that take&self
to all net types (#2845) - sync:
get_mut()
forMutex
,RwLock
(#2856). - sync:
mpsc::Sender::closed()
waits forReceiver
half to close (#2840). - sync:
mpsc::Sender::is_closed()
returns true ifReceiver
half is closed (#2726). - stream:
iter
anditer_mut
toStreamMap
(#2890). - net: implement
AsRawSocket
on windows (#2911). - net:
TcpSocket
creates a socket without binding or listening (#2920).
- io: vectored ops are removed from
AsyncRead
,AsyncWrite
traits (#2882). - io:
mio
is removed from the public API.PollEvented
andRegistration
are removed (#2893). - io: remove
bytes
from public API.Buf
andBufMut
implementation are removed (#2908). - time:
DelayQueue
is moved totokio-util
(#2897).
- io:
stdout
andstderr
buffering on windows (#2734).
- docs: misc improvements (#2572, #2658, #2663, #2656, #2647, #2630, #2487, #2621, #2624, #2600, #2623, #2622, #2577, #2569, #2589, #2575, #2540, #2564, #2567, #2520, #2521, #2493)
- rt: allow calls to
block_on
inside calls toblock_in_place
that are themselves insideblock_on
(#2645) - net: fix non-portable behavior when dropping
TcpStream
OwnedWriteHalf
(#2597) - io: improve stack usage by allocating large buffers on directly on the heap (#2634)
- io: fix unsound pin projection in
AsyncReadExt::read_buf
andAsyncWriteExt::write_buf
(#2612) - io: fix unnecessary zeroing for
AsyncRead
implementors (#2525) - io: Fix
BufReader
not correctly forwardingpoll_write_buf
(#2654) - io: fix panic in
AsyncReadExt::read_line
(#2541)
- coop: returning
Poll::Pending
no longer decrements the task budget (#2549)
- io: little-endian variants of
AsyncReadExt
andAsyncWriteExt
methods (#1915) - task: add
tracing
instrumentation to spawned tasks (#2655) - sync: allow unsized types in
Mutex
andRwLock
(viadefault
constructors) (#2615) - net: add
ToSocketAddrs
implementation for&[SocketAddr]
(#2604) - fs: add
OpenOptionsExt
forOpenOptions
(#2515) - fs: add
DirBuilder
(#2524)
- macros: disambiguate built-in
#[test]
attribute in macro expansion (#2503) - rt:
LocalSet
and task budgeting (#2462). - rt: task budgeting with
block_in_place
(#2502). - sync: release
broadcast
channel memory without sending a value (#2509). - time: notify when resetting a
Delay
to a time in the past (#2290)
- io:
get_mut
,get_ref
, andinto_inner
toLines
(#2450). - io:
mio::Ready
argument toPollEvented
(#2419). - os: illumos support (#2486).
- rt:
Handle::spawn_blocking
(#2501). - sync:
OwnedMutexGuard
forArc<Mutex<T>>
(#2455).
- sync:
broadcast
closing the channel no longer requires capacity (#2448). - rt: regression when configuring runtime with
max_threads
less than number of CPUs (#2457).
- docs: misc improvements (#2400, #2405, #2414, #2420, #2423, #2426, #2427, #2434, #2436, #2440).
- rt: support
block_in_place
in more contexts (#2409, #2410). - stream: no panic in
merge()
andchain()
when usingsize_hint()
(#2430). - task: include visibility modifier when defining a task-local (#2416).
- rt:
runtime::Handle::block_on
(#2437). - sync: owned
Semaphore
permit (#2421). - tcp: owned split (#2270).
- task:
LocalSet
was incorrectly marked asSend
(#2398) - io: correctly report
WriteZero
failure inwrite_int
(#2334)
- rt: bug in work-stealing queue (#2387)
- rt: threadpool uses logical CPU count instead of physical by default (#2391)
- sync: fix a regression where
Mutex
,Semaphore
, andRwLock
futures no longer implementSync
(#2375) - fs: fix
fs::copy
not copying file permissions (#2354)
- rt: fix queue regression (#2362).
- sync: Add disarm to
mpsc::Sender
(#2358).
- rt: concurrency bug in scheduler (#2273).
- rt: concurrency bug with shell runtime (#2333).
- test-util: correct pause/resume of time (#2253).
- time:
DelayQueue
correct wakeup afterinsert
(#2285).
- io: impl
RawFd
,AsRawHandle
for std io types (#2335). - rt: automatic cooperative task yielding (#2160, #2343, #2349).
- sync:
RwLock::into_inner
(#2321).
- sync: semaphore, mutex internals rewritten to avoid allocations (#2325).
- macros: unresolved import in
pin!
(#2281).
- net:
UnixStream::poll_shutdown
should callshutdown(Write)
(#2245). - process: Wake up read and write on
EPOLLERR
(#2218). - rt: potential deadlock when using
block_in_place
and shutting down the runtime (#2119). - rt: only detect number of CPUs if
core_threads
not specified (#2238). - sync: reduce
watch::Receiver
struct size (#2191). - time: succeed when setting delay of
$MAX-1
(#2184). - time: avoid having to poll
DelayQueue
after inserting new delay (#2217).
- macros:
pin!
variant that assigns to identifier and pins (#2274). - net: impl
Stream
forListener
types (#2275). - rt:
Runtime::shutdown_timeout
waits for runtime to shutdown for specified duration (#2186). - stream:
StreamMap
merges streams and can insert / remove streams at runtime (#2185). - stream:
StreamExt::skip()
skips a fixed number of items (#2204). - stream:
StreamExt::skip_while()
skips items based on a predicate (#2205). - sync:
Notify
provides basicasync
/await
task notification (#2210). - sync:
Mutex::into_inner
retrieves guarded data (#2250). - sync:
mpsc::Sender::send_timeout
sends, waiting for up to specified duration for channel capacity (#2227). - time: impl
Ord
andHash
forInstant
(#2239).
- docs: misc fixes and tweaks (#2155, #2103, #2027, #2167, #2175).
- macros: handle generics in
#[tokio::main]
method (#2177). - sync:
broadcast
potential lost notifications (#2135). - rt: improve "no runtime" panic messages (#2145).
- optional support for using
parking_lot
internally (#2164). - fs:
fs::copy
, an async version ofstd::fs::copy
(#2079). - macros:
select!
waits for the first branch to complete (#2152). - macros:
join!
waits for all branches to complete (#2158). - macros:
try_join!
waits for all branches to complete or the first error (#2169). - macros:
pin!
pins a value to the stack (#2163). - net:
ReadHalf::poll()
andReadHalf::poll_peak
(#2151) - stream:
StreamExt::timeout()
sets a per-item max duration (#2149). - stream:
StreamExt::fold()
applies a function, producing a single value. (#2122). - sync: impl
Eq
,PartialEq
foroneshot::RecvError
(#2168). - task: methods for inspecting the
JoinError
cause (#2051).
#[tokio::main]
whenrt-core
feature flag is not enabled (#2139).- remove
AsyncBufRead
fromBufStream
impl block (#2108). - potential undefined behavior when implementing
AsyncRead
incorrectly (#2030).
BufStream::with_capacity
(#2125).- impl
From
andDefault
forRwLock
(#2089). io::ReadHalf::is_pair_of
checks if providedWriteHalf
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 firstNone
(#2085).StreamExt::merge
combines two streams, yielding values as they become ready (#2091).- Task-local storage (#2126).
AsyncSeek
impl forFile
(#1986).- rt: shutdown deadlock in
threaded_scheduler
(#2074, #2082). - rt: memory ordering when dropping
JoinHandle
(#2044). - docs: misc API documentation fixes and improvements.
- depend on new version of
tokio-macros
.
- potential deadlock when dropping
basic_scheduler
Runtime. - calling
spawn_blocking
from within aspawn_blocking
(#2006). - storing a
Runtime
instance in a thread-local (#2011). - miscellaneous documentation fixes.
- rt: fix
Waker::will_wake
to return true when tasks match (#2045). - test-util:
time::advance
runs pending tasks before changing the time (#2059).
net::lookup_host
maps aT: ToSocketAddrs
to a stream ofSocketAddrs
(#1870).process::Child
fields are made public to matchstd
(#2014).- impl
Stream
forsync::broadcast::Receiver
(#2012). sync::RwLock
provides an asynchronous 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 ofResult<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).- expose runtime options from the
#[tokio::main]
and#[tokio::test]
(#2022).
fs::File::seek
API regression (#1991).
io::AsyncSeek
trait (#1924).Mutex::try_lock
(#1939)mpsc::Receiver::try_recv
andmpsc::UnboundedReceiver::try_recv
(#1939).writev
support forTcpStream
(#1956).time::throttle
for throttling streams (#1949).- implement
Stream
fortime::DelayQueue
(#1975). sync::broadcast
provides a fan-out channel (#1943).sync::Semaphore
provides an async semaphore (#1973).stream::StreamExt
provides stream utilities (#1962).
- deadlock risk while shutting down the runtime (#1972).
- panic while shutting down the runtime (#1978).
sync::MutexGuard
debug output (#1961).- misc doc improvements (#1933, #1934, #1940, #1942).
- runtime threads are configured with
runtime::Builder::core_threads
andruntime::Builder::max_threads
.runtime::Builder::num_threads
is deprecated (#1977).
sync::Mutex
deadlock whenlock()
future is dropped early (#1898).
- read / write integers using
AsyncReadExt
andAsyncWriteExt
(#1863). read_buf
/write_buf
for reading / writingBuf
/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 nowSync
(#1888).- impl conversions between
tokio::time::Instant
andstd::time::Instant
(#1904).
- calling
spawn_blocking
after runtime shutdown (#1875). LocalSet
drop infinite loop (#1892).LocalSet
hang under load (#1905).- improved documentation (#1865, #1866, #1868, #1874, #1876, #1911).
- scheduling with
basic_scheduler
(#1861). - update
spawn
panic message to specify that a task scheduler is required (#1839). - API docs example for
runtime::Builder
to include a task scheduler (#1841). - general documentation (#1834).
- building on illumos/solaris (#1772).
- panic when dropping
LocalSet
(#1843). - API docs mention the required Cargo features for
Builder::{basic, threaded}_scheduler
(#1858).
- impl
Stream
forsignal::unix::Signal
(#1849). - API docs for platform specific behavior of
signal::ctrl_c
andsignal::unix::Signal
(#1854). - API docs for
signal::unix::Signal::{recv, poll_recv}
andsignal::windows::CtrlBreak::{recv, poll_recv}
(#1854). File::into_std
andFile::try_into_std
methods (#1856).
- API docs for
TcpListener::incoming
,UnixListener::incoming
(#1831).
tokio::task::LocalSet
provides a strategy for spawning!Send
tasks (#1733).- export
tokio::time::Elapsed
(#1826). - impl
AsRawFd
,AsRawHandle
fortokio::fs::File
(#1827).
A major breaking change. Most implementation and APIs have changed one way or another. This changelog entry contains a highlight
- APIs are updated to use
async / await
. - most
tokio-*
crates are collapsed into this crate. - Scheduler is rewritten.
tokio::spawn
returns aJoinHandle
.- A single I/O / timer is used per runtime.
- I/O driver uses a concurrent slab for allocating state.
- components are made available via feature flag.
- Use
bytes
0.5 tokio::codec
is moved totokio-util
.
- Standalone
timer
andnet
drivers are removed, useRuntime
instead current_thread
runtime is removed, usetokio::runtime::Runtime
withbasic_scheduler
instead.
- Bump
tokio-trace-core
version to 0.2 (#1111).
tokio::runtime::Builder::panic_handler
allows configuring handling panics on the runtime (#1055).
- Re-export
tokio::sync::Mutex
primitive (#964).
TypedExecutor
re-export and implementations (#993).
- Propagate trace subscriber in the runtime (#966).
- async-await: track latest nightly changes (#940).
sync::Watch
, a single value broadcast channel (#922).- Async equivalent of read / write file helpers being added to
std
(#896).
- Use feature flags to break up the crate, allowing users to pick & choose components (#808).
- Export
UnixDatagram
andUnixDatagramFramed
(#772).
- Fix
Runtime::reactor()
when no tasks are spawned (#721). runtime::Builder
no longer uses deprecated methods (#749).- Provide
after_start
andbefore_stop
configuration settings forRuntime
(#756). - Implement throttle stream combinator (#736).
- runtime: expose
keep_alive
on runtime builder (#676). - runtime: create a reactor per worker thread (#660).
- codec: fix panic in
LengthDelimitedCodec
(#682). - io: re-export
tokio_io::io::read
function (#689). - runtime: check for executor re-entry in more places (#708).
- Fix
tokio-async-await
dependency (#675).
- Fix minimal versions
- Experimental async/await improvements (#661).
- Re-export
TaskExecutor
fromtokio-current-thread
(#652). - Improve
Runtime
builder API (#645). tokio::run
panics when called from the context of an executor (#646).- Introduce
StreamExt
with atimeout
helper (#573). - Move
length_delimited
intotokio
(#575). - Re-organize
tokio::net
module (#548). - Re-export
tokio-current-thread::spawn
in current_thread runtime (#579).
- Extract tokio::executor::current_thread to a sub crate (#370)
- Add
Runtime::block_on
(#398) - Add
runtime::current_thread::block_on_all
(#477) - Misc documentation improvements (#450)
- Implement
std::error::Error
for error types (#501)
- Add
Runtime::block_on
for concurrent runtime (#391). - Provide handle to
current_thread::Runtime
that allows spawning tasks from other threads (#340). - Provide
clock::now()
, a configurable source of time (#381).
- Add asynchronous filesystem APIs (#323).
- Add "current thread" runtime variant (#308).
CurrentThread
: Expose innerPark
instance.- Improve fairness of
CurrentThread
executor (#313).
- Provide timer API (#266)
- Fix build on FreeBSD (#218)
- Shutdown the Runtime when the handle is dropped (#214)
- Set Runtime thread name prefix for worker threads (#232)
- Add builder for Runtime (#234)
- Extract TCP and UDP types into separate crates (#224)
- Optionally support futures 0.2.
- Fix
CurrentThread::turn
to block on idle (#212).
- Introduce Tokio Runtime (#141)
- Provide
CurrentThread
for more flexible usage of current thread executor (#141). - Add Lio for platforms that support it (#142).
- I/O resources now lazily bind to the reactor (#160).
- Extract Reactor to dedicated crate (#169)
- Add facade to sub crates and add prelude (#166).
- Switch TCP/UDP fns to poll_ -> Poll<...> style (#175)
- Doc fixes
- Initial crate released based on RFC.