3673 Commits

Author SHA1 Message Date
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
Alex Crichton
2c5e4ebba8 Merge pull request #64 from alexcrichton/add-bytes
Move Framed from tokio-proto to core
2016-10-21 16:10:08 -07:00
Alex Crichton
b84ef90a98 Move Framed from tokio-proto to core
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-21 11:46:32 -07:00
Alex Crichton
3ced812993 Merge pull request #55 from oconnor663/read_once
rename Read to ReadOnce and expose it
2016-10-16 13:32:45 -07:00
Jack O'Connor
6789527952 rename ReadOnce back to Read, but keep it exposed 2016-10-15 09:46:59 -04:00
Alex Crichton
eecf3d129c Merge pull request #58 from oberien/master
fix(examples): Fix typos in chat example
2016-10-14 14:48:46 -07:00
oberien
7cf7833631 fix(examples): Fix typos in chat example
Rephrase a sentence to not contain the word `join` when we are actually using
`select` to prevent confusion.
2016-10-14 23:03:46 +02:00
Alex Crichton
bc2f857236 Touch up the chat example 2016-10-13 11:36:32 -07:00
Alex Crichton
688b67c8d8 Don't need regex from env_logger 2016-10-12 23:34:58 -07:00
Alex Crichton
227f454c52 Merge branch 'master' of https://github.com/oberien/tokio-core 2016-10-12 23:33:29 -07:00
oberien
315f601822 ref(examples): Minor refactoring in chat example
* Move connections-clone down a bit
* Use `Ok` and `Err` as IntoFuture
2016-10-11 20:08:13 +02:00
Alex Crichton
62514fc40b Merge pull request #52 from tailhook/intervals
Implement `tokio_core::reactor::Interval`
2016-10-10 08:00:22 -07:00
Paul Colomiets
b1d02eb598 Implement tokio_core::reactor::Interval 2016-10-10 15:41:57 +03:00
Jack O'Connor
da37ad0948 rename Read to ReadOnce and expose it
The other read futures (read_exact, read_until, etc.) all expose their
concrete future types so that function signatures can return them, but
until now `read()` didn't. Exposing it with the name "Read" causes
naming conflicts with the std::io::Read trait, so the easiest thing to
do is to just change the name. Importing std::io::Read under a different
name would've been an option too, but that would probably be annoying
for consumers in the same way it's annoying for us.

The original PR (https://github.com/tokio-rs/tokio-core/pull/29) decided
that "read" was a better name than "read_some", so I'm leaving the top
level functions unchanged. I don't have a strong opinion about it one
way or the other, but I *do* think it's worth bikeshedding a little bit.
Python's asyncio library actually ended up with a very similar issue
around naming inconsistency between the sync and async worlds, and we
can hopefully avoid repeating that: https://bugs.python.org/issue22279
2016-10-08 01:28:39 -04:00
oberien
b227738bd7 ref(chat): Make code more readable
* Send source address of message in addition to the message to connected clients.
* Move `spawn_fn` to the bottom.
* Use `map` instead of `and_then` if there is no need for blocking.
* `map` to unit where values are not needed anymore.
2016-10-07 14:57:30 +02:00
Paul Colomiets
411caa786d Moves when to Timeout from TimeoutToken 2016-10-06 21:11:46 +03:00
oberien
6961efa8dd fix(chat): Implement alexcrichton's suggestions
* Remove unnecessary clone
* Improve rightward drift
* Remove unnecessary lazy future
* Improve utf-8 handling
* Refactor to make code more understandable
2016-10-06 15:38:20 +02:00
Alex Crichton
a99b2529e0 Merge pull request #51 from debris/patch-1
fixed typo in split.rs
2016-10-05 09:03:02 -07:00
Marek Kotewicz
a94be1bca9 fixed typo in split.rs 2016-10-05 11:28:46 +02:00
oberien
0205b855d0 Add Chat example 2016-10-04 20:02:52 +02:00
Alex Crichton
e32115b1b4 Merge pull request #50 from oberien/read
doc(read): Add number of bytes read to doc
2016-10-04 07:50:44 -07:00