summaryrefslogtreecommitdiffstats
path: root/tests
AgeCommit message (Collapse)Author
2016-12-08Add test for EPOLLHUP without EPOLLINAndreas Rottmann
Note that this brings in a lot of machinery just for the sake of wrapping file descriptors as PollEvented. This should maybe be moved into the public API of some crate.
2016-11-22Fixup Result-returning encode methodAlex Crichton
2016-11-21Remove `Framed::split` because it's now in futuresPaul Colomiets
2016-11-15Reintroduce "decoder" and "encoder" for Decode and Encode, and merge theAaron Turon
traits into `Codec` A previous commit refactored such that `Encode` and `Decode` are implemented directly on the types being encoded or decoded. This was thought to be less expressive but more convenient than having a separate notion of a (stateful) encoder or decoder. However, there are certain situations where the approach is just too limiting: you're required to implemented `Decode` and `Encode` for types you don't "own" and can't newtype. This commit moves back to a setup where `Self` represents the encoder/decoder state; it also merges the two traits into a single `Codec` trait, since they are currently always used together.
2016-11-11Merge branch 'aphs-core-stream' of https://github.com/aidanhs/tokio-coreAlex Crichton
2016-11-08Fix line-frames testAlex Crichton
2016-11-08Refactor framing to use Streams and SinksAaron Turon
- Gets rid of `easy` module, instead providing framing support directly in the `io` module. - In particular, adds a framing adapter directly to the `Io` trait, which gives you a Stream + Sink object. That object can then be `split` into separate `Stream` and `Sink` objects if needed. - Deprecates the `FramedIo` trait; that's now just Stream + Sink. - Updates the line framing test to use the stream/sink combinators.
2016-11-06Add `turn` on `Core` to allow single event loop iterationsAidan Hobson Sayers
2016-10-25Polish tokio-core in prep for overall 0.1 releaseAaron Turon
This commit makes a few tweaks to the new `easy` module: - Rename `Parse` to `Decode`, and `Serialize` to `Encode`. - Don't use `Poll` for the `decode` method; we prefer to reserve that type for actual aync events, and in particular for a `NotReady` result to imply that some task scheduling has taken place. Instead, use an internal `Option`.
2016-10-21Fix testsAlex Crichton
2016-10-21Move Framed from tokio-proto to coreAlex Crichton
This commit extracts the concrete implementation of `FrameIo` in tokio-proto to tokio-core under the name `EasyFramed`. This extraction is accompanied with a new `EasyBuf` buffer type to work with when parsing types. The purpose of this movement is to provide a clear and easy entry point at the `FramedIo` layer for those who need it. Eventually these buffer types will get replaced or moved to the `bytes` crate, but in the interest of an 0.1 release and remaining backwards compatible with the tokio-core 0.1 release this is adding a separate module.
2016-10-10Implement `tokio_core::reactor::Interval`Paul Colomiets
2016-09-08Don't remove timeouts that have firedAlex Crichton
Closes #22
2016-09-07Swap Handle/PinnedAlex Crichton
* 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-07Tweak TaskIo wording and suchAlex Crichton
* Remove TaskIo * task_split -> split * TaskIoRead -> ReadHalf * TaskIoWrite -> WriteHalf Closes #18
2016-09-07Reorganize the entire crate:Alex Crichton
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-02Update with Poll/Async changesAlex Crichton
2016-08-31Update to futures masterAlex Crichton
* 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-26Rename to tokio-core, add in futures-ioAlex Crichton
Renames the futures-mio crate to tokio-core, pulls in the futures-io crate under an `io` module, and gets everything compiling.
2016-08-21Update futures-mio testsJean Pierre Dudey
2016-08-17Relax the 'static bound on Loop::runAlex Crichton
We know that the future will never persist beyond this stack frame, so we can just leave its ownership on the stack frame itself and receive notifications off the event loop that we need to poll it.
2016-08-17Update futures-minihttpAlex Crichton
2016-08-17Re-work I/OAlex Crichton
* Auto-register interest whenever we see WouldBlock * Remove implementations of `Stream<Item=Ready>`, no longer needed * Add explicit `poll_{read,write}` methods, if needed * Remove all I/O streams, libstd ones suffice * Update all I/O futures
2016-08-17Remove Future::scheduleAlex Crichton
A more appealing model is actually just automatically inferring what needs to be scheduled based on what actions are done during poll. For example if during a poll you check a oneshot channel, then the current task is registered for being woken up if it's not ready. Similarly this will apply to I/O where if I/O is attempted but we see EAGAIN then we'll schedule the task to get notified when it's ready. This may also have performance benefits in some niche situations because you don't need to recompute where you are in the state machine both during poll and during schedule. Instead, it now happens all at once.
2016-08-15Keep polling in Buffered if there's more futuresAlex Crichton
We're not NotReady until we hit the final future and it's not done.
2016-08-05Don't export the `timer_wheel` moduleAlex Crichton
Move tests into that module
2016-08-03Add a timer wheelAlex Crichton
2016-08-02Add a simple UDP testAlex Crichton
2016-07-30Let's rename everything!Alex Crichton