103 Commits

Author SHA1 Message Date
Nikolai Kuklin
1b98d5ad85
task: add tokio_util::task::JoinQueue (#7590) 2025-09-20 15:38:59 +08:00
Martin Grigorov
86de2e306b
util: fix pending_only_on_first_poll_with_cancellation_token_owned_test to use an owned cancellation token (#7613)
The name of the test suggests that it should test the
with_cancellation_token_owned() extension method
2025-09-15 16:22:42 +09:00
Martin Grigorov
7a0ca807be
time: add #[track_caller] to FutureExt::timeout (#7588)
Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
2025-09-11 09:18:40 +02:00
Conrad Ludgate
416e36b0df
task: stabilise JoinMap (#7075) 2025-08-03 07:58:28 +00:00
yanyuxing
0e5c5d64f5
future: add adapters of CancellationToken for FutureExt (#7475) 2025-07-29 18:09:13 +08:00
Conrad Ludgate
9e94fa7e15
task: remove raw-entry feature from hashbrown dep (#7252) 2025-07-22 15:52:54 +02:00
Stepan Tubanov
6d868d96ce
sync: fix CancellationToken failing to cancel the ready futures (#7462)
This patch fixes an issue where the `CancellationToken::run_until_cancelled` never cancels the `Future` that returns `Ready` at the first `poll`.

---------

Co-authored-by: Luca BRUNO <lucab@lucabruno.net>
2025-07-20 10:03:29 +08:00
shangchenglumetro
a1ee3ef218
chore: fix some minor typos in the comments (#7442)
Signed-off-by: shangchenglumetro <shuang.cui@live.com>
2025-07-04 11:29:27 +02:00
Geoffry Song
912b862a05
task: add AbortOnDropHandle::detach (#7400) 2025-06-10 09:35:48 +02:00
Conrad Ludgate
c3037adac9
task: properly handle removed entries in JoinMap (#7264) 2025-04-15 16:33:20 +02:00
Ty Larrabee
e4a39d2ef6
sync: add CancellationToken::run_until_cancelled_owned (#7081) 2025-03-10 14:24:25 +01:00
Taiki Endo
7f09959b0a
chore: use [lints] to address unexpected_cfgs lint (#7124) 2025-01-25 17:46:21 +01:00
tiif
eb72ddde3b
task: run spawn_pinned tests with miri (#7023) 2024-12-08 12:45:16 +01:00
Zettroke
129f9fc0c8
codec: fix incorrect handling of invalid utf-8 in LinesCodec::decode_eof (#7011) 2024-12-04 10:18:14 +00:00
Hamir Mahal
d4178cf349
tokio: avoid positional fmt params when possible (#6978) 2024-11-18 13:50:58 +01:00
tiif
161b8c80d5
ci: test more things with miri (#6885) 2024-10-11 09:44:50 +02:00
Eduardo Sánchez Muñoz
12b2567b95
chore: use poll_fn from std (#6810) 2024-09-05 09:54:06 +02:00
Rafael Bachmann
1ac8dff213
task: add AbortOnDropHandle type (#6786) 2024-08-20 10:58:04 +02:00
Adam Cigánek
1e798d26ed
time: wake DelayQueue when removing last item (#6752) 2024-08-06 16:22:31 +02:00
Timo
53ea44bfb9
sync: add CancellationToken::run_until_cancelled (#6618) 2024-06-13 10:58:45 +02:00
Alice Ryhl
2a0df5fb05
ci: bump nightly to nightly-2024-05-05 (#6538) 2024-05-05 15:43:11 +00:00
Quentin Perez
01ed7b55f7
net: add Apple visionOS support (#6465) 2024-04-06 18:09:43 +02:00
Siech0
3936ebdfe4
chore: update CI to clippy 1.77 (#6443) 2024-03-30 15:49:42 +09:00
M.Amin Rayej
8342e4b524
util: assert compatibility between LengthDelimitedCodec options (#6414) 2024-03-24 01:12:24 +03:30
Vincent Palancher
c9e75785c8
sync: remove 'static bound on impl Sink for PollSender (#6397)
In PR #5665, the `'static` bound has been removed on values sent into
`PollSender`. One of this bound was remaining on the `PollSender`
implementation of `Sink`. This patch removes it and adds some tests on
the `Sink` interface for `PollSender`.
2024-03-14 10:23:59 +01:00
M.Amin Rayej
58edfc61ab
ci: verify that tests work with panic=abort (#6283) 2024-01-16 16:10:23 +01:00
Taiki Endo
84c5674c60
ci: update clippy version to 1.75 (#6273) 2024-01-07 02:33:37 +09:00
simlay
4c33ed33f6
net: add Apple watchOS support (#6176) 2023-11-29 21:16:48 +01:00
Alice Ryhl
70410836ae
task: add tokio_util::sync::TaskTracker (#6033) 2023-10-22 14:35:19 +00:00
Andrea Stedile
f1e41a4ad4
task: add JoinMap::keys (#6046)
Co-authored-by: Alice Ryhl <aliceryhl@google.com>
2023-10-15 16:47:41 +02:00
Luís Cruz
52b29b33bb
net: add apple tvos support (#6045) 2023-10-04 18:48:53 +02:00
Weijia Jiang
707fb4d0df
tokio: remove wildcard in match patterns (#5970) 2023-09-23 22:05:44 +02:00
Colin Walters
fd7d0ad5e5
io: add SyncIOBridge::into_inner (#5971) 2023-09-01 13:01:22 +00:00
Dhruv Vats
910a1e2fcf
io: fix futures_io::AsyncSeek implementaion for Compat (#5783) 2023-06-25 13:04:35 +02:00
Daniel Bloom
c999699f5e
sync: remove 'static bound from PollSender (#5665) 2023-05-09 16:01:57 +00:00
isabelleatkins
9f9e596eec
time: fix panic in DelayQueue (#5630) 2023-04-17 20:51:42 +00:00
Jens Reidel
effead29d1
time: add DelayQueue::peek (#5569)
Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2023-04-16 09:43:03 +02:00
Alice Ryhl
2dfe4e8885
time: fix repeatedly_reset_entry_inserted_as_expired test (#5570) 2023-03-21 18:06:22 +01:00
Carl Lerche
22cff80048
chore: update CI's clippy version to 1.65 (#5276) 2022-12-06 19:56:13 -08:00
Jiahao XU
304b5152a7
sync: add owned future for CancellationToken (#5153) 2022-11-21 15:03:09 +00:00
Alice Ryhl
fc9518b627
chore: bump clippy version (#5173) 2022-11-06 12:44:26 +01:00
Daniel Bischof
620880f4ca
io: add tokio_util::io::{CopyToBytes, SinkWriter} (#5070)
Co-authored-by: Alice Ryhl <aliceryhl@google.com>
Co-authored-by: Simon Farnsworth <simon@farnz.org.uk>
2022-10-30 11:04:22 +00:00
Duarte Nunes
29c6de0e3e
sync: add PollSemaphore::poll_acquire_many (#5137) 2022-10-30 10:06:10 +01:00
crusader-mike
cbbf81b922
codec: expose backpressure_boundary in Framed API (#5124) 2022-10-29 14:59:22 +00:00
Simon Farnsworth
96fab053ab
io: wrappers for inspecting data on IO resources (#5033) 2022-09-28 18:21:51 +00:00
imlk
733931d85f
io: add SyncIoBridge::shutdown() (#4938) 2022-08-24 12:18:53 +00:00
Josh Soref
f3e340a35b
chore: fix spelling mistakes (#4858)
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-07-25 07:26:01 +00:00
Richard Zak
6d3f92dddc
wasm: initial support for wasm32-wasi target (#4716)
This adds initial, unstable, support for the wasm32-wasi target. Not all of Tokio's
features are supported yet as WASI's non-blocking APIs are still limited.

Refs: tokio-rs/tokio#4827
2022-07-12 13:20:26 -07:00
Hayden Stainsby
ad412a9833
util: add track_caller to public APIs (#4785)
* util: add track_caller to public APIs

Functions that may panic can be annotated with `#[track_caller]` so that
in the event of a panic, the function where the user called the
panicking function is shown instead of the file and line within Tokio
source.

This change adds `#[track_caller]` to all the non-unstable public APIs in
tokio-util where the documentation describes how the function may panic
due to incorrect context or inputs.

In one place, an assert was added where the described behavior appeared
not to be implemented. The documentation for `DelayQueue::reserve`
states that the function will panic if the new capacity exceeds the
maximum number of entries the queue can contain. However, the function
didn't panic until a higher number caused by an allocation failure. This
is inconsistent with `DelayQueue::insert_at` which will panic if the
number of entries were to go over MAX_ENTRIES.

Tests are included to cover each potentially panicking function.

Refs: #4413

* fix tests on FreeBSD 32-bit (I hope)

Some tests were failing on FreeBSD 32-bit because the "times too far in
the future" for DelayQueue were also too far in the future for the OS.

Fixed by copying the MAX_DURATION value from where it's defined and
using it to create a duration that is just 1 more than the maximum. This
will start to break once we get close (within 2 and a bit years) of the
Epochalypse (19 Jan, 2038) - but a lot of other things are going to be
breaking on FreeBSD 32-bit by then anyway.
2022-06-27 12:31:31 +02:00
b-naber
d8fb721de2
task: improve LocalPoolHandle (#4680) 2022-06-17 18:37:00 +02:00