Commit Graph
12 Commits
Author SHA1 Message Date
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
Alex Crichton 9911f421eb Add LoopPin to easily create LoopData 2016-08-12 13:42:24 -07:00
Alex Crichton 517d5c7434 Add libcurl bindings 2016-08-09 23:51:14 -07:00
Alex Crichton 304914b707 Start brushing up io/mio docs 2016-08-05 09:53:50 -07:00
Alex Crichton 8eb1f681af Don't export the timer_wheel module
Move tests into that module
2016-08-05 09:44:00 -07:00
Alex Crichton e7f4313cf4 Implementing LoopData
This type acts for a handle to storage of non-`Send` data. The handle itself is
sendable across threads and is therefore suitable for storage in a `Future`.
This data uses communication internally and a new method on `Task` to ensure
that when the data needs to be accessed the future will find its way to the
right thread.

More on this type coming soon!
2016-08-04 20:34:54 -07:00
Alex Crichton 5c9daad88b Add a timer wheel 2016-08-03 22:57:07 -07:00
Alex Crichton 260255e674 Add UDP sockets 2016-08-02 22:49:58 -07:00
Alex Crichton 5970203b21 Finish docs on futures-mio
Also remove mio BufReader/BufWriter for now, they should come back shortly
though
2016-08-01 17:41:58 -07:00
Alex Crichton 7ffe72dc73 Add docs to futures-io crate 2016-08-01 17:30:56 -07:00
Alex Crichton bc64194be1 Let's rename everything! 2016-07-30 22:50:58 -07:00