2416 Commits

Author SHA1 Message Date
Taiki Endo
7384813979
chore: update proptest to 1 (#3653) 2021-03-27 19:34:11 +09:00
Taiki Endo
a257a3a2b1
io: add AsyncSeekExt::stream_position (#3650) 2021-03-27 12:28:51 +09:00
Alexandr
9a3603fa75
chore: fix several typos in docs (#3651) 2021-03-27 12:27:52 +09:00
Alice Ryhl
724ba348d1
chore: fix warning from new Rust version (#3647) 2021-03-26 19:22:43 +09:00
Kai Jewson
0dc4769708
sync: add OwnedRwLockReadGuard and OwnedRwLockWriteGuard (#3340) 2021-03-23 13:40:17 +01:00
Mihail Malo
6f896d8846
macros: add missing => in doc (#3638) 2021-03-22 21:37:29 +01:00
Daniel Franklin
10abc45da1
io: clarify requirements of AsyncFd (#3635) 2021-03-22 21:16:40 +01:00
Moritz Gunz
227b3e0d9c
chore: avoid allocation if PollSemaphore is unused (#3634) 2021-03-22 17:02:30 +01:00
quininer
c659e4a757
task: add sync_scope for LocalKey (#3612) 2021-03-22 17:02:10 +01:00
somethingelseentirely
8ed825fd49
util: makes Framed and FramedStream resumable after eof (#3272) 2021-03-22 09:09:01 +01:00
Ibraheem Ahmed
63395f061e
macros: fix typo in select macro docs (#3629) 2021-03-21 20:10:28 +01:00
Kai Jewson
69b129b405
stream: avoid yielding in AllFuture and AnyFuture (#3625) 2021-03-21 09:34:18 +01:00
David Pedersen
0bfcbc8be5
runtime: fix unclear docs for {Handle,Runtime}::block_on (#3628) 2021-03-20 14:52:25 +01:00
David Pedersen
81f47e8866
util: fix indentation and typos in DelayQueue docs (#3626) 2021-03-20 14:31:12 +01:00
David Pedersen
b4918adbd8
chore: prepare tokio-stream v0.1.5 (#3624) tokio-stream-0.1.5 2021-03-20 12:17:37 +01:00
David Pedersen
b1310ad14d
chore: prepare tokio-util v0.6.5 (#3622) tokio-util-0.6.5 2021-03-20 12:16:56 +01:00
David Pedersen
dcac336dc7
chore: prepare Tokio v1.4.0 (#3621) tokio-1.4.0 2021-03-20 12:16:15 +01:00
David Pedersen
c39d9867bb
runtime: add Handle::block_on (#3569)
Add `runtime::Handle::block_on`. The function enters the runtime context and
blocks the current thread while the future executes.

Refs: #3097
Fixes #2965, #3096
2021-03-20 10:52:28 +01:00
Ivan Petkov
e4f76688a0
runtime: fix memory leak/growth when creating many runtimes (#3564) 2021-03-16 19:31:46 +01:00
Zahari Dichev
e6103d6661
docs: add link to PollSender (#3613)
There was no link to [`PollSender`] in [`mpsc::Sender`] docs which made it
less discoverable.

[`PollSender`]: https://docs.rs/tokio-util/0.6.4/tokio_util/sync/struct.PollSender.html
[`mpsc::Sender::send`]: https://docs.rs/tokio/1.3.0/tokio/sync/mpsc/struct.Sender.html
2021-03-16 17:55:06 +01:00
David Pedersen
cc90a5c679
chore: mention fix for building docs in contributing guide (#3618)
I ran into this when writing the docs for `Handle::block_on`. Seems to
be caused by a bug in cargo. Until that is fixed I think it makes sense
to mention it in the contributing guide.
2021-03-16 21:39:28 +09:00
David Pedersen
f107c4f49b
timer: fix double newline in module docs (#3617) 2021-03-16 21:37:50 +09:00
Zahari Dichev
e6a9167bb7
runtime: avoid unnecessary polling of block_on future (#3582) 2021-03-16 10:30:18 +01:00
setpill
345b29ca11
sync: improve Mutex FIFO explanation (#3615) 2021-03-12 21:24:05 +01:00
Nate Mara
b75d02a2b6
macros: introduce biased argument for select! (#3603) 2021-03-12 21:20:20 +01:00
Faraz
a1b4bdee61
runtime: mark EnterGuard with must_use (#3609) 2021-03-12 09:06:08 +01:00
Zahari Dichev
edfff7551a
util: anotate time module as requiring time feature (#3606)
Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
2021-03-11 16:02:01 +01:00
Rob Ede
1cda0f16a2
doc: alias sleep to delay (#3604) 2021-03-10 23:26:11 +01:00
Lucio Franco
e40ec3e424
chore: Prepare tokio-test v0.4.1 release (#3602) tokio-test-0.4.1 2021-03-10 16:04:08 -05:00
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