395 Commits

Author SHA1 Message Date
Alex Crichton
01198532c1 Merge pull request #263 from casey/timeout-debug
Derive Debug for Timeout and TimeoutToken
2017-10-10 13:59:02 -04:00
Casey Rodarmor
e10de1e94e Derive Debug for Timeout and TimeoutToken 2017-10-09 20:16:38 -07:00
Alex Crichton
335c3e73a4 Fix UDP test 2017-10-05 19:57:36 -07:00
Alex Crichton
1c88b8f336 Bump to 0.1.10 2017-10-05 10:47:57 -07:00
Alex Crichton
84916f66fd Take &SocketAddr in connect 2017-10-05 10:47:57 -07:00
Alex Crichton
259c7a0884 Make poll_at private again
Unsure that we'll want to continue to expose this, stick to being conservative
for now.
2017-10-05 10:46:51 -07:00
Alex Crichton
25760609fa Avoid 0-length IoVec instances
These are unsound on Windows (unfortunately) and will soon be disallowed due to
carllerche/iovec#5
2017-10-05 10:41:05 -07:00
Alex Crichton
0868b97832 Add a tinydb example sharing state
This example is intended to showcase sharing state between all connected clients
on a server, for example a key/value store (in-memory database)

Closes #257
2017-09-23 12:22:34 -07:00
Alex Crichton
fbd0a9e5f1 Merge pull request #258 from alex/patch-1
Fixed docs for Timeout::new and new_at
2017-09-22 11:54:03 -05:00
Alex Gaynor
24dd856cfd Fixed docs for Timeout::new and new_at
They no longer return futures, they return io::Result.
2017-09-22 11:01:34 -04:00
Alex Crichton
e33155edb1 Merge pull request #255 from mathstuf/doc-typos
docs: fix some typos
2017-09-14 15:36:20 -05:00
Ben Boeckel
de33e02c01 docs: fix some typos 2017-09-14 16:19:45 -04:00
Alex Crichton
317c11552c Merge pull request #254 from alexcrichton/poll-at
Add {Interval,Timeout}::poll_at
2017-09-13 20:43:48 -05:00
Alex Crichton
fb05eb34af Merge pull request #253 from alexcrichton/perf
Conditionally call `consume_queue` on messages
2017-09-13 16:33:26 -05:00
Alex Crichton
25dcb1fab5 Add {Interval,Timeout}::poll_at
Some contexts, like EC2, have `Instant::now` as a relatively expensive function
to call. To help amortize the cost of this function this commit exposes a new
function on `Interval` and `Timeout` to pass in the assumed current time.
2017-09-12 22:55:58 -07:00
Alex Crichton
97d80296cb Conditionally call consume_queue on messages
The `consume_queue` function can be relatively slow for an empty queue (the fast
path) so optimize this a bit with a preflight check that should just touch a few
atomics.
2017-09-12 21:42:22 -07:00
Alex Crichton
b320d9ee58 Move timer heap assertions behind a dedicated cfg
No need to punish projects that enable debug assertions for themselves
2017-09-12 10:58:41 -07:00
Alex Crichton
63d7be0368 Merge pull request #251 from bkchr/udpsocket_connect
Adds UdpSocket connect, send and recv methods
2017-09-12 09:27:24 -05:00
Bastian Köcher
7950b43505 Adds a test for UdpSocket connect, recv and send 2017-09-12 14:37:40 +02:00
Bastian Köcher
c80105fe1e Adds UdpSocket connect, send and recv methods 2017-09-12 14:00:55 +02:00
Alex Crichton
8a43472b35 Add an example of compressing on a CPU pool 2017-09-11 14:41:15 -07:00
Alex Crichton
ecedea3404 Add a README for the examples 2017-09-11 13:31:08 -07:00
Alex Crichton
2e5cd1640e Merge pull request #250 from henninglive/udp-zero-length
UDP 0-length datagrams
2017-09-11 10:43:40 -05:00
Alex Crichton
85257e19af Touch up a few examples 2017-09-11 08:43:11 -07:00
Alex Crichton
a611f6ec30 Add a UDP mode to the connect example 2017-09-11 08:33:09 -07:00
Henning Ottesen
bda6ed9241 UDP 0-length datagrams
Resolves #248, preventing UdpFramed from sending 0-length datagrams.
Also, adds 0-length tests for UdpSocket.
2017-09-11 17:32:37 +02:00
Alex Crichton
5e4cfdfab1 Recommend the connect example over nc 2017-09-11 08:07:38 -07:00
Alex Crichton
e0b751b013 Relax exact interval tests
Should make this more resilient to rounding errors on Windows
2017-09-11 07:44:32 -07:00
Alex Crichton
5e92b10f3f Add a "tiny" HTTP example
Hopefully being relatively illustrative in how a bare-bones non-production-ready
server can be spun up!
2017-09-10 21:45:23 -07:00
Alex Crichton
a4e947fba0 Make timeout tests slightly more flexible 2017-09-10 19:58:35 -07:00
Alex Crichton
7b94cf307d Add a multithreaded echo server example 2017-09-10 08:54:35 -07:00
Alex Crichton
645ae7051d Merge pull request #247 from twmb/timeout_token_doc
TokenTimeout: add doc around new panic
2017-09-09 14:21:30 -05:00
Travis Bischel
b9dc4c9008 TokenTimeout: add doc around new panic
My slab bump in #246 added a potential new panic in Core's Inner's
`cancel_timeout`.

Thankfully, the only way `cancel_timeout` can be called is from
TimeoutToken's `cancel_timeout`, which is crate-internal only and is
only called from Timeout's and Interval's drop fn's.

This change simply adds new clarifying documentation around
TokenTimeout's cancel_timeout to "future proof" anybody looking to use
cancel_timeout directly (not just on drop).
2017-09-08 22:31:37 -07:00
Alex Crichton
e30b182147 Merge pull request #246 from twmb/bump_slab
bump slab to 0.4.0
2017-09-08 09:01:38 -05:00
Travis Bischel
fce59de79e bump slab to 0.4.0
Makes some of the code easier to read.
2017-09-07 20:53:54 -07:00
Alex Crichton
04eba12d43 Merge pull request #244 from arthurprs/errorkind
Prefer ErrorKind::WouldBlock
2017-09-03 16:00:13 -05:00
arthurprs
f12b761b77 Prefer ErrorKind::WouldBlock 2017-09-03 18:39:04 +02:00
Alex Crichton
e8617ea1fc Update futures dependency 2017-08-24 08:16:04 -07:00
Alex Crichton
77d9a1aa4f Merge pull request #226 from Ralith/udp-dual-stack
Expose only_v6 option for UDP sockets
2017-08-17 13:05:31 -07:00
Alex Crichton
6090e22135 Merge pull request #238 from cssivision/master
update example in doc comment
2017-08-16 09:04:34 -07:00
cssivision
e5fdccfff0 update example in doc comment 2017-08-16 19:17:12 +08:00
Alex Crichton
fbd257f2bd Merge pull request #237 from raphlinus/master
[fuchsia] Config changes to build on Fuchsia
2017-07-31 18:59:12 -05:00
Raph Levien
05b1ba4342 [fuchsia] Config changes to build on Fuchsia
This patch disables various Unix-specific platform features that are
not enabled on Fuchsia. It also updates the mio version to 0.6.10,
which is the first release that supports Fuchsia.
2017-07-31 14:12:53 -07:00
Alex Crichton
77b0ee0a47 Hide the deprecated io module 2017-07-30 20:49:09 -07:00
Alex Crichton
2a71ef8b13 Merge pull request #236 from manuels/patch-1
Add documentation about panics to {Handle, Remote}::spawn{fn}
2017-07-26 11:57:24 -05:00
manuels
d03c736b4c Add documentation about panics to {Handle, Remote}::spawn{fn} 2017-07-26 17:33:09 +02:00
Alex Crichton
8c297a6208 Bump to 0.1.9 2017-07-24 21:36:19 -07:00
Alex Crichton
8fba4858ac Merge pull request #231 from guanqun/master
typo fix in io_token's comment section
2017-07-12 09:07:23 -05:00
Guanqun Lu
5fe7b4225f typo fix in io_token's comment section 2017-07-12 13:21:54 +08:00
Alex Crichton
c13e7f3533 Clarify docs on Timeout::reset 2017-06-27 09:55:36 -07:00