3561 Commits

Author SHA1 Message Date
Alice Ryhl
02aacf5110
sync: make TokenBucket::close into a destructor in example (#6032) 2023-09-24 14:16:14 +02:00
Weijia Jiang
707fb4d0df
tokio: remove wildcard in match patterns (#5970) 2023-09-23 22:05:44 +02:00
Alice Ryhl
b161633b5f
sync: reorder Semaphore examples (#6031) 2023-09-23 19:53:44 +02:00
M.Amin Rayej
f5b8cf9dac
sync: add token bucket example to Semaphore (#5978) 2023-09-23 17:45:30 +02:00
Rebekah Kim
aa36807c02
sync: fix docs typo (#6030) 2023-09-23 12:33:41 +02:00
Alice Ryhl
74c7a87985
Merge 'tokio-1.32.x' into 'master' (#6028) 2023-09-22 20:00:09 +02:00
Alice Ryhl
ccb37c4f39
Merge 'tokio-1.25.2' into 'tokio-1.32.x' (#6027) 2023-09-22 19:58:58 +02:00
Alice Ryhl
9ab4ca68ac chore: prepare Tokio v1.25.2 (#6026) tokio-1.25.2 2023-09-22 18:32:04 +02:00
Alice Ryhl
60a0ca58fa Merge 'tokio-1.20.6' into 'tokio-1.25.x' (#6025) 2023-09-22 18:26:10 +02:00
Alice Ryhl
938c7eb023 chore: prepare Tokio v1.20.6 (#6024) tokio-1.20.6 2023-09-22 13:44:00 +02:00
Alice Ryhl
bfa9ea8d9b io: use memchr from libc (#5960) 2023-09-22 13:40:01 +02:00
Uwe Klotz
9bc782acfc
sync: fix incorrect comment (#6020) 2023-09-21 10:44:27 +02:00
Chris Constantine
3f6165d82e
chore: prepare tokio-util v0.7.9 (#6019) tokio-util-0.7.9 2023-09-20 19:30:12 +02:00
Uwe Klotz
ad7f988da3
sync: fix mark_changed when version overflows (#6017) 2023-09-19 15:44:08 +00:00
nicflower
9d51b76d01
sync: add watch::Sender::new (#5998) 2023-09-19 16:01:36 +02:00
Uwe Klotz
804511822b
sync: rename watch::mark_unseen to watch::mark_changed (#6014) 2023-09-19 13:13:46 +00:00
Alexander Kirilin
e6553c4ee3
sync: add Semaphore example using an Arc<Semaphore> (#5956) 2023-09-19 14:13:19 +02:00
M.Amin Rayej
98bb3be094
ci: fix ci on tokio-1.20.x (#5999) 2023-09-19 00:16:15 +02:00
Hayden Stainsby
d247e7f5df
sync: document that const_new() is not instrumented (#6002) 2023-09-13 13:49:02 +02:00
Victor Timofei
65e7715909
util: replace sync::reusable_box::Pending with std::future::Pending (#6000) 2023-09-12 08:53:05 +09:00
Victor Timofei
61042b4d90
sync: add watch::Receiver::mark_unseen (#5962) 2023-09-11 13:50:29 +02:00
Icenowy Zheng
1c428cc558
tokio: fix cache line size for RISC-V (#5994) 2023-09-11 07:22:14 +00:00
Alexandre Bléron
61f095fdc1
sync: add ?Sized bound to {MutexGuard,OwnedMutexGuard}::map (#5997) 2023-09-10 20:08:12 +02:00
Marek Kuskowski
65027b60bc
io: add Interest::remove method (#5906) 2023-09-10 16:46:07 +02:00
M.Amin Rayej
b046c0dcbb
benches: use criterion instead of bencher (#5981) 2023-09-10 16:42:53 +02:00
Adam Chalmers
737dff40cb
task: rename generic paramter for spawn (#5993) 2023-09-10 11:21:51 +02:00
Weijia Jiang
a6be73eecb
codec: document the line ending used by LinesCodec (#5982) 2023-09-08 15:59:48 +02:00
M.Amin Rayej
9fafe783d3
io: support vectored writes for DuplexStream (#5985) 2023-09-08 12:57:18 +02:00
Joan Antoni RE
fb3ae0a254
docs: fix worker_overflow_count (#5988) 2023-09-07 14:16:52 -05:00
Hayden Stainsby
aad1892ab5
task: fix spawn_local source location (#5984)
The location of a spawned task, as shown in tokio console, is taken from
the location set on the tracing span that instruments the task. For this
location to work, there must be unbroken chain of functions instrumented
with `#[track_caller]`.

For `task::spawn_local`, there was a break in this chain and so the
span contained the location of an internal function in tokio.

This change adds the missing `#[track_caller]` attribute. It has been
tested locally as automated tests would really need `tracing-mock` to be
published so we can use it in the tokio tests.
2023-09-06 10:55:47 +02:00
Hayden Stainsby
8ea303e027
chore: list 1.32.x as LTS release (#5980) 2023-09-05 10:02:50 +02:00
M.Amin Rayej
84ed35ef70
process: document that Child::wait is cancel safe (#5977) 2023-09-04 10:24:55 +02:00
Jack Wrenn
95fb599664
tokio: render taskdump documentation on docs.rs (#5972)
Modifies `package.metadata.docs.r` so that `--cfg tokio_taskdump`
is used by docs.rs when building documentation.
2023-09-02 11:43:31 +02:00
ComplexSpaces
8b312ee571
macros: use ::core qualified imports instead of ::std inside tokio::test macro (#5973) 2023-09-02 03:44:08 +09:00
Colin Walters
fd7d0ad5e5
io: add SyncIOBridge::into_inner (#5971) 2023-09-01 13:01:22 +00:00
M.Amin Rayej
37bb47c4a2
fs: add vectored writes to tokio::fs::File (#5958) 2023-08-29 14:18:16 +02:00
Rain
cb1e10b745
sync: improve docs for watch channels (#5954)
## Motivation

I found the watch docs as written to be somewhat confusing.

* It wasn't clear to me whether values are marked seen or not at
  creation/subscribe time.
* The example also confused me a bit, suggesting a while loop when a
  do-while loop is generally more correct.
* I noticed a potential race with `borrow` that is no longer an issue
  with `borrow_and_update`.

## Solution

Update the documentation for the watch module to try and make all this
clearer.
2023-08-28 16:13:07 -07:00
Alice Ryhl
fb3028f3a2
test: fix testing category slug (#5953) 2023-08-26 17:09:49 +02:00
Alice Ryhl
b45f5831cf
tokio: remove stats feature (#5952) 2023-08-26 17:09:33 +02:00
Rain
0fe24fcffa
sync: improve cancel-safety documentation for mpsc::Sender::send (#5947)
This specific issue (data loss because a send got cancelled) has bitten
our team a couple of times over the last few months. We've switched to
recommending this kind of reserve pattern instead.
2023-08-25 22:03:23 +00:00
Eliza Weisman
d1dae25cd2
ci: drop MIPS targets from cross-check (#5951)
Currently, Tokio runs cross-compilation checks for the
`mips-unknown-linux-gnu` and `mipsel-unknown-linux-musl` target triples.
However, Rust has recently demoted these targets from Tier 2 support to
Tier 3 (see rust-lang/compiler-team#648). Therefore, MIPS toolchains may
not always be available, even in stable releases. This is currently
[breaking our CI builds][1], as Rust 1.72.0 does not contain a standard
library for `mips-unknown-linux-gnu`.

This branch removes these builds from the cross-compilation check's
build matrix. Tokio may still build successfully for MIPS targets, but
we can't easily guarantee support when the stable Rust release train may
or may not be able to build for MIPS targets.

[1]: https://github.com/tokio-rs/tokio/actions/runs/5970263562/job/16197657405?pr=5947#step:3:80
2023-08-25 14:40:32 -07:00
nicflower
59c9364689
io: pass through IO traits for StreamReader and SinkWriter (#5941) 2023-08-23 17:46:39 +00:00
Alice Ryhl
3b79be624d
chore: prepare tokio-test v0.4.3 (#5943) tokio-test-0.4.3 2023-08-23 12:38:11 +02:00
Jiahao XU
8955ed5f85
sync: add const fn OnceCell::from_value (#5903)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-08-22 13:32:56 +02:00
Matilda Smeds
bc26934e3b
sync: add Semaphore example that limits open files (#5939) 2023-08-20 12:14:41 +02:00
Hamza Jadid
3d64a06600
docs: added trailing backticks (#5938) 2023-08-17 17:22:34 -05:00
Carl Lerche
a7d52c2fed
chore: prepare Tokio v1.32.0 release (#5937) tokio-1.32.0 2023-08-16 14:11:30 -07:00
Marek Kuskowski
f5f2b58b8d
rt: improve docs for Builder::max_blocking_threads (#5793)
Closes #5777
2023-08-16 12:12:53 -07:00
mahkoh
718dcc8dff
docs: BytesMut::with_capacity does not guarantee exact capacity (#5870) 2023-08-16 10:29:29 -07:00
Folkert de Vries
10e141d211
io: add Ready::ERROR and report error readiness (#5781)
Add `Ready::ERROR` enabling callers to specify interest in error readiness. Some platforms use error
readiness notifications to notify of other events. For example, Linux uses error to notify receipt of
messages on a UDP socket's error queue.

Using error readiness is platform specific.

Closes #5716
2023-08-16 10:28:19 -07:00