2387 Commits

Author SHA1 Message Date
Jake Ham
6919f7cede
test: Make Mock both Send and Sync (#3594)
Co-authored-by: Jake Ham <hamjacob@amazon.com>
2021-03-10 14:29:22 -05:00
cssivision
bcb95db4e2
chore: fix clippy warnings in newer versions (#3588) 2021-03-10 08:42:24 +01:00
Matthew James Briggs
8c5cde9bc3
stream: documentation note for throttle Unpin (#3600) 2021-03-10 08:39:43 +01:00
Alice Ryhl
b08b5edb2c
chore: prepare tokio-util v0.6.4 (#3599) tokio-util-0.6.4 2021-03-09 22:11:38 +01:00
Alice Ryhl
88863a0c5d
chore: prepare tokio-stream v0.1.4 (#3598) tokio-stream-0.1.4 2021-03-09 22:10:57 +01:00
Alice Ryhl
d0e4dd1d7b
chore: prepare Tokio v1.3.0 (#3597) tokio-1.3.0 2021-03-09 22:09:51 +01:00
Andrew Liu
872bc09e83
examples: update chat example (#3587) 2021-03-09 19:54:10 +01:00
Alice Ryhl
db1d90453c
util: fuse PollSemaphore (#3578) 2021-03-09 19:22:36 +01:00
Thomas Orozco
05eeea570e
coop: expose an unconstrained() opt-out (#3547) 2021-03-09 19:10:15 +01:00
Henry Gomersall
f70b9b84f7
sync: documenation for oneshot (#3592) 2021-03-09 18:58:45 +01:00
nickelc
704de8c01b
stream: remove duplicate doc(test(..)) & cfg_attr declarations (#3571) 2021-03-06 20:54:28 +09:00
Thomas Orozco
47be928444
sync: yield initial value in WatchStream (#3576) 2021-03-05 21:35:12 +01:00
Zhang Jingqiang
e06b257e09
sync: add same_channel method to mpsc Senders (#3532) 2021-03-04 17:45:40 +01:00
Alice Ryhl
0867a6fc03
util: add pollable mpsc::Sender (#3490) 2021-03-04 17:29:30 +01:00
Gus Wynn
0d838bf5ad
io: fix link to std src in util (#3568)
The big move or 'src' in rust-lang caused this link to be broken
2021-03-02 02:50:13 +09:00
Max Bruckner
fc23f8a1a5
sync: add {try_,}acquire_many_owned to Semaphore (#3535) 2021-03-01 14:37:00 +01:00
Pirmin Kalberer
fd93ecf5e0
stream: remove duplicate doc_cfg declaration (#3561) 2021-02-27 22:47:26 +01:00
Stepan Koltsov
d2ad7afd21
time: do not panic on timeout(Duration::MAX) (#3551)
It is tempting to use very large `Duration` value to get a practically
infinite timeout.

Before this commit Tokio panics on checked Instant + Duration
overflow.

This commit implements very simple fix: if Instant + Duration
overflows, we use duration = 30 years. Better fix should avoid
firing a timer on duration overflow. It requires deeper understanding
how timers work, but also it is not clear, for example, what
`Sleep::deadline` function should return.

Similar fix is done for `sleep`.
2021-02-26 10:04:08 +01:00
r-zig
5756a005a6
codec: LinesCodec should only return MaxLineLengthExceeded once per line (#3556) 2021-02-25 23:21:59 +01:00
Paho Lurie-Gregg
017a483b5e
io: update AsyncRead::poll_read doc (#3557)
The trait-level documentation accurately describes this method, but the
function-level documentation imples that an implementer should overwrite
the entire buf, rather than just the unfilled portion.
2021-02-25 23:19:02 +01:00
Stepan Koltsov
112e160b62
sync: allow oneshot::Receiver::close after successful try_recv (#3552)
Before this commit `close` after successful `try_recv` panics.

My use case is this: on drop, I call `close` to prevent pushing a
message to the queue, and then fetch the message if any and process
it.

But if message is already processed, `close` panics.  And there is
no API to know if message was already fetched or not (except for
writing a wrapped which would track that info, which would be an
overkill).

But generally `close` operation should be safe to be called any
time.
2021-02-25 20:28:24 +01:00
r-zig
c9d2a36c7b
codec: AnyDelimiter codec (#3406) 2021-02-23 16:56:11 +01:00
Kestrer
8efed43fa7
runtime: update documentation of thread limits (#3527)
Since ed5a94eb2db95b7cc142045fbbd5d68c6276e04e, there is no longer a
limit of 32,768 threads on the worker threads and blocking thread pool,
but the documentation has not been updated. This commit removes that
part of the documentation.
2021-02-23 16:54:50 +01:00
Marko Mikulicic
7de18af82c
doc: sync interval.rs and time/mod.rs docs (#3533) 2021-02-22 11:45:49 +01:00
xlUp
52457dcf5b
doc: fix typos (#3541)
Co-authored-by: Aaron Taner <mapkts@gmail.com>
2021-02-22 17:31:45 +09:00
Adam Harvey
53558cb489
doc: note the EOF behaviour of read_until (#3536) 2021-02-20 10:22:51 +01:00
Taiki Endo
36d7dab504
chore: remove html_root_url (#3489)
Co-authored-by: Alice Ryhl <alice@ryhl.io>
2021-02-18 14:11:39 -08:00
Kornel
6fd06aaeec
doc: doc aliases for pre-1.0 function names (#3523) 2021-02-17 13:00:44 +01:00
Pen Tree
36bcfa6b9d
doc: rename notify to notify_one (#3526) 2021-02-15 20:21:27 +01:00
Alice Ryhl
e3f2dcf5bc
sync: add back RwLockWriteGuard::map and RwLockWriteGuard::try_map (#3348) 2021-02-13 12:53:21 +01:00
Alice Ryhl
7c6a1c4637
net: update UdpSocket splitting doc (#3517) 2021-02-13 11:13:42 +01:00
Alice Ryhl
4099bfdef0
sync: do not recommend join_all for Barrier (#3514) 2021-02-12 10:43:11 +01:00
Alice Ryhl
469b43de6a
time: fix typo in Sleep doc (#3515) 2021-02-11 10:30:48 +01:00
Alice Ryhl
e827829402
signal: add Signal wrappers to tokio-stream (#3510) 2021-02-07 11:30:18 +01:00
Alice Ryhl
58bd242831
net: add into_std for net types without it (#3509) 2021-02-06 23:01:47 +01:00
Alice Ryhl
6fd9084d47
runtime: add link to LocalSet on new_current_thread (#3508) 2021-02-06 19:08:59 +01:00
Alice Ryhl
572a897d43
chore: prepare tokio v1.2.0 (#3506) tokio-1.2.0 2021-02-05 23:27:42 +01:00
Alice Ryhl
d41882e2a1
chore: prepare tokio-macros 1.1.0 (#3505) tokio-macros-1.1.0 2021-02-05 22:21:29 +01:00
Alice Ryhl
23fdc2b3c4
chore: prepare tokio-stream 0.1.3 (#3507) tokio-stream-0.1.3 2021-02-05 22:18:56 +01:00
Alice Ryhl
0a04954d5c
stream: update features and doc for broadcast/watch stream (#3504) 2021-02-05 20:39:27 +01:00
Steven Fackler
fcb6d041b9
time: make test-util paused time fully deterministic (#3492)
The time driver stores an Instant internally used as a "base" for future
time calculations. Since this is generated as the Runtime is being
constructed, it previously always happened before the user had a chance
to pause time. The fractional-millisecond variations in the timing
around the runtime construction and time pause cause tests running
entirely in paused time to be very slightly deterministic, with the time
driver advancing time by 1 millisecond more or less depending on how the
sub-millisecond components of the `Instant`s involved compared.

To avoid this, there is now a new option on `runtime::Builder` which
will create a `Runtime` with time "instantly" paused. This, along with a
small change to have the time driver use the provided clock as the
source for its start time allow totally deterministic tests with paused
time.
2021-02-05 20:12:25 +01:00
Fuyang Liu
1c1e0e3fc9
tokio-stream: add wrapper for broadcast and watch (#3384) 2021-02-05 19:56:24 +01:00
Fuyang Liu
77ca8a934c
signal: make Signal::poll_recv method public (#3383)
Signed-off-by: Fuyang Liu <liufuyang@users.noreply.github.com>
2021-02-05 19:43:58 +01:00
surechen
3e5a0a7df6
runtime: fix a spelling mistake (#3503) 2021-02-04 12:30:31 +01:00
Artem Vorotnikov
cc97fb8a5f
Suppress deprecated warnings for spin_loop_hint (#3497)
* Suppress deprecated warnings for spin_loop_hint

* Update tokio/src/loom/std/mod.rs

Co-authored-by: Taiki Endo <te316e89@gmail.com>

* Update tokio/src/sync/task/atomic_waker.rs

Co-authored-by: Taiki Endo <te316e89@gmail.com>

* fmt

Co-authored-by: Taiki Endo <te316e89@gmail.com>
2021-02-01 15:55:21 +03:00
Alice Ryhl
60d88840f4
chore: prepare tokio-util v0.6.3 (#3488) tokio-util-0.6.3 2021-01-31 12:39:22 +01:00
Alice Ryhl
ee1f0c473f
util: remove tokio-stream dependency from tokio-util (#3487) 2021-01-31 11:08:40 +01:00
Rob Ede
06d6adf4b7
util: use ReusableBoxFuture for PollSemaphore (#3463) 2021-01-30 10:57:04 +01:00
Alice Ryhl
891aba5f71
util: add ReusableBoxFuture utility (#3464) 2021-01-30 00:03:01 +01:00
Carl Lerche
10c3b2f4a3
Merge branch 'tokio-1.1.x' 2021-01-29 14:13:24 -08:00