Commit Graph
246 Commits
Author SHA1 Message Date
Thomas de Zeeuw 0b54557796 Remove unused code (#44)
* remove unused #[macro_use] and #[allow(unused_macros)]

* remove unused FnBox trait

* remove unused temporary variable

* remove Evented trait requirement to implement Debug
2017-12-01 15:34:03 -06:00
dethoter 31f8cb9467 Remove Core:id. (#41) 2017-11-21 10:18:11 -08:00
Carl Lerche 4c268a8939 Make Handle Send + Sync. (#35)
* Make Handle `Send + Sync`.

This is an initial implementation making `Handle: Send + Sync`. It uses
a `RwLock` to coordinate access to the underlying state storage. An
implementation without the lock is left to later.

This pass also leaves a lot of dead code that can be removed in later
commits.

* Remove reactor code related to message passing

The previous commit removed the need for using message passing to
communicate with the reactor. This commit removes all the unnecessary
code.
2017-11-17 12:51:23 -08:00
Carl Lerche c6f1ff13d2 Remove executor from reactor.
In accordance with tokio-rs/tokio-rfcs#3, the executor functionality of
Tokio is being removed and will be relocated into futures-rs as a
"current thread" executor.

This PR removes task execution from the code base. As a temporary
mesure, all examples and tests are switched to using CpuPool.

Depends on #19.
2017-11-01 07:28:49 -07:00
Carl Lerche 697851210c Remove timers from Tokio.
In accordance with tokio-rs/tokio-rfcs#3, timers are being extracted
from Tokio and moved to a separate crate (probably futures-timer).

This PR removes timers from the code base.
2017-10-30 18:16:00 -07:00
Carl Lerche b23a997cb8 Remove deprecated code.
This commit removes code that was deprecated in tokio-core master.
2017-10-30 16:37:15 -07:00
Carl Lerche 36aaaa1520 Rename crate to tokio 2017-10-30 16:37:00 -07:00
Taylor Cramer 3588f4d6ad Simplify UdpSocket futures 2017-10-27 10:10:55 -07:00
Alex Crichton ca8104ad69 Merge pull request #272 from cramertj/must-use
Set Future types as must_use
2017-10-27 12:19:21 -04:00
Taylor Cramer 7624061021 Set Sink types as must_use 2017-10-25 18:03:31 -07:00
Taylor Cramer bd9a07f3ad Set Stream types as must_use 2017-10-25 18:02:14 -07:00
Taylor Cramer b4fa47bd09 Set Future types as must_use 2017-10-25 17:57:25 -07:00
Taylor Cramer 6b8ad4ff99 Fix warnings 2017-10-25 17:27:24 -07:00
Casey Rodarmor e10de1e94e Derive Debug for Timeout and TimeoutToken 2017-10-09 20:16:38 -07:00
Alex Crichton 84916f66fd Take &SocketAddr in connect 2017-10-05 10:47:57 -07:00
Alex Crichton 259c7a0884 Make poll_at private again
Unsure that we'll want to continue to expose this, stick to being conservative
for now.
2017-10-05 10:46:51 -07:00
Alex Crichton 25760609fa Avoid 0-length IoVec instances
These are unsound on Windows (unfortunately) and will soon be disallowed due to
carllerche/iovec#5
2017-10-05 10:41:05 -07:00
Alex Gaynor 24dd856cfd Fixed docs for Timeout::new and new_at
They no longer return futures, they return io::Result.
2017-09-22 11:01:34 -04:00
Ben Boeckel de33e02c01 docs: fix some typos 2017-09-14 16:19:45 -04:00
Alex Crichton 317c11552c Merge pull request #254 from alexcrichton/poll-at
Add {Interval,Timeout}::poll_at
2017-09-13 20:43:48 -05:00
Alex Crichton 25dcb1fab5 Add {Interval,Timeout}::poll_at
Some contexts, like EC2, have `Instant::now` as a relatively expensive function
to call. To help amortize the cost of this function this commit exposes a new
function on `Interval` and `Timeout` to pass in the assumed current time.
2017-09-12 22:55:58 -07:00
Alex Crichton 97d80296cb Conditionally call consume_queue on messages
The `consume_queue` function can be relatively slow for an empty queue (the fast
path) so optimize this a bit with a preflight check that should just touch a few
atomics.
2017-09-12 21:42:22 -07:00
Alex Crichton b320d9ee58 Move timer heap assertions behind a dedicated cfg
No need to punish projects that enable debug assertions for themselves
2017-09-12 10:58:41 -07:00
Bastian Köcher c80105fe1e Adds UdpSocket connect, send and recv methods 2017-09-12 14:00:55 +02:00
Alex Crichton 2e5cd1640e Merge pull request #250 from henninglive/udp-zero-length
UDP 0-length datagrams
2017-09-11 10:43:40 -05:00
Henning Ottesen bda6ed9241 UDP 0-length datagrams
Resolves #248, preventing UdpFramed from sending 0-length datagrams.
Also, adds 0-length tests for UdpSocket.
2017-09-11 17:32:37 +02:00
Alex Crichton e0b751b013 Relax exact interval tests
Should make this more resilient to rounding errors on Windows
2017-09-11 07:44:32 -07:00
Travis Bischel b9dc4c9008 TokenTimeout: add doc around new panic
My slab bump in #246 added a potential new panic in Core's Inner's
`cancel_timeout`.

Thankfully, the only way `cancel_timeout` can be called is from
TimeoutToken's `cancel_timeout`, which is crate-internal only and is
only called from Timeout's and Interval's drop fn's.

This change simply adds new clarifying documentation around
TokenTimeout's cancel_timeout to "future proof" anybody looking to use
cancel_timeout directly (not just on drop).
2017-09-08 22:31:37 -07:00
Travis Bischel fce59de79e bump slab to 0.4.0
Makes some of the code easier to read.
2017-09-07 20:53:54 -07:00
arthurprs f12b761b77 Prefer ErrorKind::WouldBlock 2017-09-03 18:39:04 +02:00
Alex Crichton e8617ea1fc Update futures dependency 2017-08-24 08:16:04 -07:00
Alex Crichton 77d9a1aa4f Merge pull request #226 from Ralith/udp-dual-stack
Expose only_v6 option for UDP sockets
2017-08-17 13:05:31 -07:00
cssivision e5fdccfff0 update example in doc comment 2017-08-16 19:17:12 +08:00
Raph Levien 05b1ba4342 [fuchsia] Config changes to build on Fuchsia
This patch disables various Unix-specific platform features that are
not enabled on Fuchsia. It also updates the mio version to 0.6.10,
which is the first release that supports Fuchsia.
2017-07-31 14:12:53 -07:00
Alex Crichton 77b0ee0a47 Hide the deprecated io module 2017-07-30 20:49:09 -07:00
manuels d03c736b4c Add documentation about panics to {Handle, Remote}::spawn{fn} 2017-07-26 17:33:09 +02:00
Guanqun Lu 5fe7b4225f typo fix in io_token's comment section 2017-07-12 13:21:54 +08:00
Alex Crichton c13e7f3533 Clarify docs on Timeout::reset 2017-06-27 09:55:36 -07:00
Yuanchao Sun 6fb62d3232 Add a method to reset Timeout. 2017-06-27 11:34:56 +08:00
Benjamin Saunders 8004900ce9 Expose only_v6 option for UDP sockets 2017-06-25 22:56:52 -07:00
Sean McArthur bf93b79120 make TcpStream::flush() a noop 2017-06-23 15:25:25 -07:00
Alex Crichton c65c331767 Merge pull request #210 from asomers/aio5
POSIX AIO support, try 2
2017-06-08 14:30:22 -05:00
Alan Somers 363e15f36c Respond to alexchrichton's comments
* Combine the FreeBSD/Dragonfly platform with the other Unix platform
* Remove the Windows platform::aio method
* Update deps
2017-06-07 22:36:32 -06:00
Alex Crichton 16d15520ad Update tokio-core with new task system 2017-05-30 08:42:32 -07:00
Carl Lerche 7acffe4785 Expose TCP socket options 2017-05-27 09:37:25 -07:00
Alan Somers 42f73cb0ec Revert changes to read_ready and add platform::all() 2017-05-21 11:01:48 -06:00
Alan Somers 81beb44565 POSIX AIO support, try 2
Support POSIX AIO, post-01635df .  A concrete implementation will be
added by the mio-aio and tokio-file crates
2017-05-21 10:24:08 -06:00
Alex Crichton 4dd3d30f2a Add PollEvented::poll_ready
This commit adds a general-purpose method for querying the readiness of a
`PollEvented` type. This new method, `poll_ready`, takes a blanket `mio::Ready`
and tests if any part of it is ready. The purpose of this is to expose
platform-specific events through `PollReady` such as `hup` and `error` events
other than just the platform-agnostic readable/writable events.

The semanatics of this method are:

* The `poll_ready` function takes a mask, and the return value is either
  `Async::Ready` with a subset of these events that are ready or `None` if none
  of them are ready.
* There can be up to two tasks blocked on a `PollEvented`, so we need to pick
  which one is suitable for these new events. Currently all events are routed to
  the `read` task unless the writable bit is set. This is mostly only relevant
  for multi-task usage or if you're manually calling `need_read` and/or
  `need_write`, and hopefully the docs will cover this now.
2017-05-19 11:23:00 -07:00
Alex Crichton b92fd2d22a Update to latest mio version 2017-05-19 10:00:57 -07:00
king6cong 4d8d293913 typo fix 2017-05-12 18:00:55 +08:00