198 Commits

Author SHA1 Message Date
Sebastian Dröge
ab5025a8b7 Remove now unused UdpSocketNew
See https://github.com/tokio-rs/tokio-core/issues/15#issuecomment-245552463
2016-09-09 19:23:42 +03:00
Alex Crichton
8f92dc9d56 Add a simple "hello" example 2016-09-09 00:11:08 -07:00
Carl Lerche
0000210e0c Add io::FramedIo 2016-09-08 23:25:17 -07:00
Alex Crichton
83784fd983 Don't remove timeouts that have fired
Closes #22
2016-09-08 07:47:07 -07:00
Alex Crichton
cd331dde34 Merge pull request #23 from frewsxcv/docs
Add links in docs to `channel` function.
2016-09-08 07:35:49 -07:00
Corey Farwell
eb643c4d9e Add links in docs to channel function. 2016-09-08 10:33:41 -04:00
Alex Crichton
1f0d2198ad Use a timer heap instead of a timer wheel
In general it's easier to implement and should have more predictable performance
semantics for applications in general. More serious timer usage can go through
`tokio-timer` which has properly configurable timer wheels and such.

Closes #2
Closes #7
2016-09-08 00:06:34 -07:00
Alex Crichton
66cff8e84b Swap Handle/Pinned
* Handle -> Remote
* Pinned -> Handle

All APIs now take a `&Handle` by default and in general can return an immediate
`io::Result` instead of an `IoFuture`. This reflects how most usage will likely
be done through handles rather than remotes, and also all previous functionality
can be recovered with a `oneshot` plus `Remote::spawn`.

Closes #15
2016-09-07 22:12:41 -07:00
Alex Crichton
e60002b653 Tweak TaskIo wording and such
* Remove TaskIo
* task_split -> split
* TaskIoRead -> ReadHalf
* TaskIoWrite -> WriteHalf

Closes #18
2016-09-07 22:12:14 -07:00
Alex Crichton
6c045d31ac Reorganize the entire crate:
Renamed APIs

* Loop => reactor::Core
* LoopHandle => reactor::Handle
* LoopPin => reactor::Pinned
* TcpStream => net::TcpStream
* TcpListener => net::TcpListener
* UdpSocket => net::UdpSocket
* Sender => channel::Sender
* Receiver => channel::Receiver
* Timeout => reactor::Timeout
* ReadinessStream => reactor::PollEvented
* All `LoopHandle` methods to construct objects are now free functions on the
  associated types, e.g. `LoopHandle::tcp_listen` is now `TcpListener::bind`
* All APIs taking a `Handle` now take a `Handle` as the last argument
* All future-returning APIs now return concrete types instead of trait objects

Added APIs

* io::Io trait -- Read + Write + ability to poll

Removed without replacement:

* AddSource
* AddTimeout
* IoToken
* TimeoutToken

Closes #3
Closes #6
2016-09-07 22:12:14 -07:00
Alex Crichton
93c61bb384 Merge pull request #21 from frewsxcv/clippy
Address a few clippy suggestions.
2016-09-07 21:19:40 -07:00
Alex Crichton
0eeeca4ac1 Merge pull request #20 from frewsxcv/docs
Add documentation links.
2016-09-07 21:19:12 -07:00
Corey Farwell
9fe1d8aeca Remove unnecessary return statements. 2016-09-07 21:30:11 -04:00
Corey Farwell
a9d24810be Avoid unnecessary Option::expect indirection. 2016-09-07 21:29:52 -04:00
Corey Farwell
93e1d4778d Use while..let construct for loop. 2016-09-07 21:29:37 -04:00
Corey Farwell
d7f76ca549 Add documentation links. 2016-09-07 21:19:34 -04:00
Alex Crichton
815dc803db Merge pull request #19 from kamalmarhubi/read-exact-doc
docs: Fix copypasta in read_exact docs
2016-09-07 15:25:40 -07:00
Kamal Marhubi
abf4521300 docs: Fix copypasta in read_exact docs 2016-09-07 18:12:09 -04:00
Alex Crichton
03ac1ea460 Merge pull request #14 from reem/patch-1
Fix the link for the echo server example in the README
2016-09-03 10:27:55 -07:00
Jonathan Reem
242f8fa1b2 Fix the link for the echo server example. 2016-09-02 23:22:27 -07:00
Alex Crichton
3794cf7f1d Update with Poll/Async changes 2016-09-02 12:17:38 -07:00
Alex Crichton
3282b3ec0d Update to mio 0.6 2016-09-01 22:14:26 -07:00
Carl Lerche
2081bcc430 Track Slab changes 2016-09-01 10:12:15 -07:00
Alex Crichton
6947933b6b Be sure to call poll before doing I/O
Ensures that we can properly clear the readiness bits and manage them correctly.

Closes #10
2016-09-01 09:27:42 -07:00
Alex Crichton
02538d035f Move binaries to examples 2016-09-01 09:18:03 -07:00
Alex Crichton
6c6fb917ee Merge pull request #8 from nbigaouette/patch-1
Fix typo in Loop::run() documentation
2016-09-01 09:00:14 -07:00
Nicolas Bigaouette
376974c349 Fix typo in Loop::run() documentation
Simple typo fixed (`becuase` -> `because`)
2016-08-31 22:35:19 -04:00
Alex Crichton
330ab823b0 Update to futures master
* Remove `LoopData` as it's no longer necessary
* Add `LoopHandle::spawn` to spawn new futures onto an event loop
* Add `LoopData::spawn` to also spawn new futures onto an event loop
* Rejigger the implementation of the event loop a bit (make a slab of futures),
  but otherwise everything else is pretty constant.
2016-08-31 19:00:42 -07:00
Carl Lerche
440a813c5a Track mio master 2016-08-30 14:45:29 -07:00
Alex Crichton
7a852a7f49 Merge pull request #4 from sinkuu/fix_dropbox
Fix DropBox's drop
2016-08-28 10:56:11 -07:00
sinkuu
909f3e923c Fix DropBox's drop 2016-08-28 16:06:45 +09:00
Alex Crichton
c820d67d66 Update to mio master 2016-08-27 12:33:31 -07:00
Alex Crichton
b9395808be Merge pull request #1 from sbstp/typo
Fix typo in panic message
2016-08-26 19:11:51 -07:00
Simon Bernier St-Pierre
32557cd832 fix typo in panic message 2016-08-26 21:47:50 -04:00
Alex Crichton
3715e62471 Update appveyor link 2016-08-26 14:57:55 -07:00
Alex Crichton
235812a4da Add license files 2016-08-26 14:56:21 -07:00
Alex Crichton
37a53a1085 Update appveyor status 2016-08-26 14:51:40 -07:00
Alex Crichton
347669ed2b Add appveyor config 2016-08-26 14:45:55 -07:00
Alex Crichton
d6e8998582 Update travis token 2016-08-26 14:44:01 -07:00
Alex Crichton
f107c8d860 Rename to tokio-core, add in futures-io
Renames the futures-mio crate to tokio-core, pulls in the futures-io crate under
an `io` module, and gets everything compiling.
2016-08-26 14:39:47 -07:00
Alex Crichton
e71d509fee Add a &LoopPin to add_loop_data closures
This way they can use that proof that they're running on the event loop
2016-08-24 18:44:47 -07:00
Alex Crichton
d1cd455225 Implement Stream for Receiver
That's... what it is!
2016-08-22 10:10:03 -07:00
Aaron Turon
cff73b7a9d Merge pull request #87 from alexcrichton/less-arc
Don't store an Arc in ReadinessStream
2016-08-21 21:18:53 -07:00
Jean Pierre Dudey
9c309af597 Update futures-mio tests 2016-08-21 11:30:59 -04:00
Alex Crichton
df9730fcbe Add a channel to the futures-mio crate 2016-08-20 23:41:19 -07:00
Alex Crichton
2bd616df51 Reorganize the event_loop module
Split it up into a number of targeted modules for each purpose, for example loop
data, I/O sources, timeouts, and channels. No actual change is intended to be
part of this commit.
2016-08-20 23:24:56 -07:00
Alex Crichton
b9dae23e3f Don't store an Arc in ReadinessStream
This commit contains a few refactorings, but the major goal is to remove the
`Arc` that's stored inside of each `ReadinessStream` and `Scheduled` slot in the
event loop. The original purpose of this `Arc` was to share the I/O object among
the concrete handle itself and the event loop. The event loop would then change
how the socket is registered over time and then deregister it when it gets a
"shutdown request".

Nowadays, however, once an I/O object is registered with the event loop it's
never updated. Additionally, we don't actually need to call `deregister` but can
rather just instead close the I/O object itself and let the kernel/event loop
take care of the cleanup. All we need to do on deregistering is free up the slab
entry.

The major result of this commit is that I/O objects no longer need to be `Sync`
(as they're not stored in an `Arc`). Instead they just need to be `Send +
'static` as one might otherwise expect.

Along the way this also refactors a few pieces here and there to make more sense
in this new scheme. The `ReadinessStream` type now has a type parameter
indicating an owned reference to the I/O object it wraps. This can be accessed
via the `get_ref` and `get_mut` methods. Additionally I/O tokens on the event
loop are now a full-fledged `IoToken` type which we can change in the future if
we need to.
2016-08-20 23:07:00 -07:00
David Renshaw
5ab323e5c2 Revert to using futures::lazy(), which is in fact needed. 2016-08-20 16:22:54 -04:00
David Renshaw
a9b53d61d2 update comment and simplify echo example 2016-08-20 11:52:16 -04:00
Alex Crichton
0a707ffccb Update docs of futures-mio 2016-08-18 10:29:11 -07:00