2117 Commits

Author SHA1 Message Date
messense
3cc6ce7a99
doc: update version to 0.3 in module documentation (#2974) 2020-10-16 13:49:30 +02:00
Alice Ryhl
81db03204d
Fix doc typo (#2967) 2020-10-16 12:37:21 +02:00
John-John Tedro
1644511bdf Update documentation of AsyncRead to reflect use of ReadBuf 2020-10-16 11:55:35 +02:00
Carl Lerche
dc9742fbea
chore: post release Cargo.toml fixes (#2963) 2020-10-15 11:46:10 -07:00
Carl Lerche
12f1dffa2d
chore: prepare for v0.3.0 release (#2960) tokio-0.3.0 2020-10-15 09:22:07 -07:00
Taiki Endo
871289b3e7
ci: run clippy on MSRV (#2962) 2020-10-15 06:30:20 +09:00
Lucio Franco
30b40ef518
rt: update docs for 0.3 changes (#2956)
This PR updates the runtime module docs to the changes made in `0.3`
release of tokio.

Closes #2720
2020-10-13 15:49:19 -07:00
Carl Lerche
22fa883296
rt: tweak spawn_blocking docs (#2955) 2020-10-13 15:07:10 -07:00
Carl Lerche
00b6127f2e
rt: switch enter to an RAII guard (#2954) 2020-10-13 15:06:22 -07:00
Ivan Petkov
a249421abc
process: update docs regarding zombie processes (#2952) 2020-10-13 00:42:17 +00:00
Carl Lerche
1923350880
meta: combine net and dns, use parking_lot (#2951)
This combines the `dns` and `net` feature flags. Previously, `dns` was
included as part of `net`. Given that is is rare that one would want
`dns` without `net`, DNS is now entirely gated w/ `net`.

The `parking_lot` feature is included as part of `full`.

Some misc docs are tweaked to reflect feature flag changes.
2020-10-12 16:06:02 -07:00
Taiki Endo
c90681bd8e
rt: simplify rt-* features (#2949)
tokio:

    merge rt-core and rt-util as rt
    rename rt-threaded to rt-multi-thread

tokio-util:

    rename rt-core to rt

Closes #2942
2020-10-12 14:13:23 -07:00
Ivan Petkov
24d0a0cfa8
chore: refactor runtime driver usage of Either (#2918) 2020-10-12 19:57:22 +00:00
Lucio Franco
07802b2c84
rt: worker_threads must be non-zero (#2947)
Co-authored-by: Alice Ryhl <alice@ryhl.io>
2020-10-12 15:15:40 -04:00
Taiki Endo
891de3271d
net: merge tcp, udp, uds features to net feature (#2943) 2020-10-13 03:36:26 +09:00
Lucio Franco
8880222036
rt: Remove threaded_scheduler() and basic_scheduler() (#2876)
Co-authored-by: Alice Ryhl <alice@ryhl.io>
Co-authored-by: Carl Lerche <me@carllerche.com>
2020-10-12 13:44:54 -04:00
Juan Alvarez
0893841f31
time: move error types into time::error (#2938) 2020-10-12 10:21:44 -07:00
Lucio Franco
ec99e61945
time: Clean up Instant docs to align with std (#2946)
Co-authored-by: Alice Ryhl <alice@ryhl.io>
2020-10-12 13:06:55 -04:00
Lucio Franco
f8c91f2ead
io: Rename ReadBuf methods (#2945)
This changes `ReadBuf::add_filled` to `ReadBuf::advance` and
`ReadBuf::append` to `ReadBuf::put_slice`. This is just a
mechanical change.

Closes #2769
2020-10-12 12:41:40 -04:00
Zahari Dichev
b575082543
sync: change chan closed(&mut self) to closed(&self) (#2939) 2020-10-12 12:09:36 -04:00
Taiki Endo
c4f620cb30
chore: remove use of doc_alias feature (#2944) 2020-10-12 09:42:59 +02:00
Taiki Endo
b047f647b7
net: make UCred fields private (#2936) 2020-10-11 09:31:26 +02:00
Taiki Endo
2e05399f4b
sync: move broadcast error types into broadcast::error module (#2937)
Refs: #2928
2020-10-09 10:10:22 -07:00
Carl Lerche
afe535283c
fs: future proof File (#2930)
Changes inherent methods to take `&self` instead of `&mut self`. This
brings the API in line with `std`.

This patch is implemented by using a `tokio::sync::Mutex` to guard the
internal `File` state. This is not an ideal implementation strategy
doesn't make a big impact compared to having to dispatch operations to a
background thread followed by a blocking syscall.

In the future, the implementation can be improved as we explore async
file-system APIs provided by the operating-system (iocp / io_uring).

Closes #2927
2020-10-09 10:02:55 -07:00
Carl Lerche
ee597347c5
net: switch socket methods to &self (#2934)
Switches various socket methods from &mut self to &self. This uses the intrusive
waker infrastructure to handle multiple waiters.

Refs: #2928
2020-10-09 09:16:42 -07:00
Taiki Endo
41ac1ae2bc
io: make Seek and Copy private (#2935)
Refs: #2928
2020-10-09 08:33:14 -07:00
Juan Alvarez
60d81bbe10
time: rename Delay future to Sleep (#2932) 2020-10-08 20:35:12 -07:00
bdonlan
b704c53b9c
chore: Fix clippy lints (#2931)
Closes: #2929

Co-authored-by: Bryan Donlan <bdonlan@amazon.com>
2020-10-08 17:14:39 -07:00
Carl Lerche
066965cd59
net: use &self with TcpListener::accept (#2919)
Uses the infrastructure added by #2828 to enable switching
`TcpListener::accept` to use `&self`.

This also switches `poll_accept` to use `&self`. While doing introduces
a hazard, `poll_*` style functions are considered low-level. Most users
will use the `async fn` variants which are more misuse-resistant.

TcpListener::incoming() is temporarily removed as it has the same
problem as `TcpSocket::by_ref()` and will be implemented later.
2020-10-08 12:12:56 -07:00
Taiki Endo
6259893094
fs: add os::windows::OpenOptionsExt (#2923) 2020-10-08 11:09:12 +02:00
Zahari Dichev
43bd11bf2f
io: remove Poll from the AsyncSeek::start_seek return value (#2885) 2020-10-08 10:56:01 +02:00
Taiki Endo
d94ab62c54
util: fix a typo in sync/cancellation_token.rs (#2922) 2020-10-07 15:46:13 -07:00
Carl Lerche
a9a59ea90e
net: add TcpSocket for configuring a socket (#2920)
This enables the caller to configure the socket and to explicitly bind
the socket before converting it to a `TcpStream` or `TcpListener`.

Closes: #2902
2020-10-07 13:02:29 -07:00
Taiki Endo
c248167173
fs: switch to our own DirEntryExt trait (#2921) 2020-10-08 02:30:25 +09:00
Evan Cameron
601a3ef93f
docs: more docs for UdpSocket (#2883) 2020-10-06 18:12:02 -07:00
greenwoodcm
fcdf9345bf
time: clean time driver (#2905)
* remove unnecessary wheel::Poll

the timer wheel uses the `wheel::Poll` struct as input when
advancing the timer to the next time step.  the `Poll` struct
contains an instant representing the time step to advance to
and also contains an optional and mutable reference to an
`Expiration` struct.  from what I can tell, the latter field
is only used in the context of polling the wheel and does not
need to be exposed outside of that method.  without the
expiration field the `Poll` struct is nothing more than a
wrapper around the instant being polled.  this change removes
the `Poll` struct and updates integration points accordingly.

* remove Stack trait in favor of concrete Stack implementation

* remove timer Registration struct
2020-10-06 12:48:01 -07:00
Ivan Petkov
4cf45c038b
process: add ProcessDriver to handle orphan reaping (#2907) 2020-10-06 17:30:16 +00:00
bdonlan
9730317e94
time: move DelayQueue to tokio-util (#2897)
This change is intended to do the minimum to unblock 0.3; as such, for now, we
duplicate the internal `time::wheel` structures in tokio-util, rather than trying
to refactor things at this stage.

Co-authored-by: Bryan Donlan <bdonlan@amazon.com>
2020-10-05 14:25:04 -07:00
Taiki Endo
02311dcfa1
io, stream: assert !Unpin for ext trait futures (#2913) 2020-10-06 04:44:34 +09:00
Alice Ryhl
aa171f2aa9
stream: remove bytes from public API (#2908) 2020-10-05 10:33:15 -07:00
Taiki Endo
c23c1ecbcb
io, stream: make ext trait futures !Unpin (#2910)
Make these future `!Unpin` for compatibility with async trait methods.
2020-10-05 10:32:11 -07:00
Taiki Endo
561a71ad63
net: implement AsRawSocket on Windows (#2911) 2020-10-05 10:22:19 -07:00
Alice Ryhl
242ea01189
sync: broadcast channel API tweaks (#2898)
Removes deprecated APIs and makes some small breaking changes.
2020-10-05 09:30:48 -07:00
Mikail Bagishov
1684e1c809
io: optimize writing large buffers to windows stdio (#2888) 2020-10-05 16:07:46 +02:00
Taiki Endo
0ed4127d5c
fs: seal OpenOptionsExt and DirBuilderExt (#2909) 2020-10-05 00:47:35 +09:00
Carl Lerche
1e585ccb51
io: update to Mio 0.7 (#2893)
This also makes Mio an implementation detail, removing it from the
public API.

This is based on #1767.
2020-10-02 13:54:00 -07:00
Alice Ryhl
7ec6d88b21
chore: make #[doc(hidden)] apis private (#2901) 2020-10-01 21:13:28 -07:00
Alice Ryhl
13de30c53e
task: remove deprecated JoinError constructors (#2900) 2020-10-02 01:01:11 +03:00
Alice Ryhl
496e889917
Fix new clippy warning (#2899) 2020-10-02 00:59:48 +03:00
Juan Alvarez
53ccfc1fd6
time: introduce sleep and sleep_until functions (#2826) 2020-10-01 09:24:33 +02:00