Commit Graph
193 Commits
Author SHA1 Message Date
Alex Crichton bd86bab42d Merge pull request #107 from norcalli/patch-1
Grammar in README.md
2016-11-18 09:05:09 -06:00
Ashkan Kiani bc16ad039d Grammar in README.md 2016-11-17 22:20:36 -08:00
Alex Crichton 1bc3899016 Merge pull request #104 from danburkert/master
Clean up Sink implementation on Framed
2016-11-16 22:41:24 -06:00
Dan Burkert 46dd38b7d7 Clean up Sink implementation on Framed
This commit makes a few changes to the Sink implementation on Framed:

* Backpressure is implemented for `start_send`. If the write buffer is
  over 8KiB and can't be flushed, no new items are accepted.
* 0 length writes to the upstream transport are translated into a
  `WriteZero` error, as with `io::Write::write_all`. `write_all` checks
  for and ignores `Interrupted` errors, but I do not think this is
  necessary for non-blocking writes.
* In `poll_complete`, the upstream transport is not flushed until
  *after* writing the entire write buffer.
2016-11-16 18:42:30 -08:00
Alex Crichton 89a9ab6d34 Merge pull request #102 from aturon/decoder-encoder
Reintroduce "decoder" and "encoder" for Decode and Encode, merging them into Codec
2016-11-15 10:42:34 -06:00
Aaron Turon c353de13fc Reintroduce "decoder" and "encoder" for Decode and Encode, and merge the
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-15 08:28:26 -08:00
Alex Crichton 21851dd25c Merge pull request #103 from bheesham/failing-tests
Remove references to EasyFramed and easy module.
2016-11-15 00:07:54 -06:00
Bheesham Persaud 06a4c5e2d5 Remove references to EasyFramed and easy module. 2016-11-15 00:42:46 -05:00
Alex Crichton f6241b6330 Touch up Reactor::poll 2016-11-11 14:27:49 -08:00
Alex Crichton 092574b7de Merge branch 'aphs-core-stream' of https://github.com/aidanhs/tokio-core 2016-11-11 14:06:03 -08:00
Alex Crichton 6e7410567c Typo 2016-11-11 11:26:07 -08:00
Alex Crichton 3d69a8b7d0 Add a benchmark for futures channel latency 2016-11-10 20:10:02 -08:00
Alex Crichton bbea632e04 Touch up some of the benchmarks 2016-11-10 19:50:44 -08:00
Alex Crichton 6b888ea20f Merge branch 'benches' of https://github.com/dpc/tokio-core 2016-11-10 19:33:27 -08:00
Dawid Ciężarkiewicz 7ae124077e Improve latency benchmarks. 2016-11-10 14:21:37 -08:00
Aaron Turon 17faf329e0 Add note about how to get a Framed 2016-11-10 09:46:23 -08:00
Aaron Turon 91347f44a5 Remove mentions of EasyFramed 2016-11-10 09:45:09 -08:00
Alex Crichton da3544f468 Merge pull request #97 from k4rtik/patch-1
Correct client invocation example
2016-11-09 10:11:02 -07:00
Kartik Singhal be7992e639 This works only for IPv4 addresses 2016-11-09 12:10:07 -05:00
Kartik Singhal 71baa4967d Correct client invocation example 2016-11-09 11:41:37 -05:00
Dawid Ciężarkiewicz 307ba7a867 travis: Run cargo bench on nightly 2016-11-08 19:09:26 -08:00
Dawid Ciężarkiewicz d1a2a9d324 Add channel_lantency and fix previous issues.
Warmup round before actually performing the test seems to eliminate
variance.
2016-11-08 19:01:37 -08:00
Alex Crichton 45fc13071c Fix line-frames test 2016-11-08 17:59:37 -08:00
Alex Crichton c459b9835c Merge pull request #95 from aturon/sink
Refactor framing to use Streams and Sinks
2016-11-08 16:53:21 -07:00
Aaron Turon 36e3dbf418 Refactor framing to use Streams and Sinks
- 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-08 15:47:13 -08:00
Alex Crichton 3eac142e5f Merge pull request #93 from danburkert/master
Depend directly on git version of futures-rs
2016-11-08 09:32:32 -07:00
Dan Burkert 9dce803e4a Depend directly on git version of futures-rs
Cargo replace directives are not meant for libraries, since they are not
transitively inherited by the application.
2016-11-07 20:22:06 -08:00
Aaron Turon 60796f40fd Merge pull request #82 from aturon/cleanup-for-0.1
Polish tokio-core in prep for overall 0.1 release
2016-11-06 15:26:01 -08:00
Aidan Hobson Sayers fce913c04d Add turn on Core to allow single event loop iterations 2016-11-06 22:11:18 +00:00
Alex Crichton 4744a2e48b No more need for lazy in chat example 2016-11-05 13:36:49 -07:00
Alex Crichton 6dc8333fb2 Merge pull request #92 from dwrensha/typo
Fix some typos.
2016-11-05 13:33:01 -07:00
David Renshaw f96d37ccf3 Fix some typos. 2016-11-05 16:29:54 -04:00
Alex Crichton 79136ca211 Merge pull request #91 from dwrensha/simplify-echo
Simply echo example: split() can now happen on the main task.
2016-11-05 12:49:37 -07:00
David Renshaw 556143b7c6 Simply echo example: split() can now happen on the main task. 2016-11-05 15:16:29 -04:00
Alex Crichton 614887b8c1 Implement split() with BiLock 2016-11-05 11:14:54 -07:00
Dawid Ciężarkiewicz 8e7ed8ae21 Add some benchmarks.
To be moved into separate repo.
2016-11-04 22:06:08 -07:00
Alex Crichton 0a3dc0bb75 Add a method to manually deregister an I/O object
Typically this happens automatically as the `E` in `PollEvented<E>` is an owned
reference (e.g. a `TcpStream`) where dropping that will close the resource,
automatically unregistering it from the event loop. In some situations, however,
this isn't always the case, so the deregistering needs to happen manually.
2016-11-04 09:12:00 -07:00
Alex Crichton 4615c3ea78 Touch up the echo examples 2016-11-02 16:57:27 -07:00
Dawid Ciężarkiewicz 237bcead7a Add UDP echo server example. 2016-11-02 16:30:37 -07:00
Aaron Turon 503f4a0405 Polish tokio-core in prep for overall 0.1 release
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-25 15:15:18 -07:00
Alex Crichton 623ce443d8 Add some warning comments 2016-10-24 20:03:27 -07:00
Alex Crichton 88fb0b32af Merge pull request #76 from spinda/into_inner
Add methods to extract inner from EasyFramed
2016-10-24 20:02:31 -07:00
Alex Crichton bb22ef5f82 Merge pull request #78 from Archytaus/master
Fix typo in TcpStream and UdpSocket documentation
2016-10-24 19:22:59 -07:00
Ryan Scott c9554fa174 Fixed a small typo of 'writey' where it was expected to be 'ready' in TcpStream and UdpSocket documentation. 2016-10-25 10:13:52 +09:00
Michael Smith a1dfa14034 Add methods to extract inner from EasyFramed 2016-10-24 09:17:40 -07:00
Alex Crichton 37a2bed4cf Merge pull request #72 from dwrensha/copy-edit
Fix typo and awkward sentences.
2016-10-22 21:20:29 -07:00
David Renshaw 4a07828095 Fix typo and awkward sentences. 2016-10-23 11:14:52 +08:00
Alex Crichton cefdb0c321 Merge pull request #71 from plietar/master
Allow start and end of window to match length of underlying slice.
2016-10-22 16:21:49 -07:00
Paul Lietar 4719fbdb28 Allow start and end of window to match length of underlying slice. 2016-10-22 15:56:02 +02:00
Alex Crichton 6d6c2aa390 Fix tests 2016-10-21 17:01:43 -07:00