169 Commits

Author SHA1 Message Date
Alex Crichton
0f49a69a06 Deprecate the channel module
The `futures::sync::mpsc` module should entirely supplant it.
2016-11-18 15:20:39 -08: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
Alex Crichton
4744a2e48b No more need for lazy in chat example 2016-11-05 13:36:49 -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
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
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
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
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
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
oberien
0205b855d0 Add Chat example 2016-10-04 20:02:52 +02:00
xenor
f41c55f9f7 Instead of calling handle() a second time in line 26, I used a reference to the value obtained in line 23. 2016-09-20 09:59:09 -07:00
Alex Crichton
8f92dc9d56 Add a simple "hello" example 2016-09-09 00:11:08 -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
02538d035f Move binaries to examples 2016-09-01 09:18:03 -07:00