hydrogen
hydrogen is a non-blocking socket server framework built atop epoll. It takes care of the tedious connection and I/O marshaling across threads, and leaves the specifics of I/O reading and writing up the consumer, through trait implementations.
Streams
hydrogen works with Stream
trait Objects so any custom type can be used.
simple-stream was built in conjunction and offers several
stream abstractions and types including Plain and Secured streams with basic
and WebSocket framing.
Multithreaded
hydrogen is multithreaded. It uses one thread for accepting incoming connections, one for updating epoll reported event, and one used for marshalling I/O into a threadpool of a user specified size.
Slab allocation
The connection pool is managed as a slab, which means traversal times are similar to traversing a Vector, with an insertion and removal time of O(1).
Example Usage
extern crate hydrogen;
extern crate simple_stream as ss;
use hydrogen;
use ;
use Frame;
use ;
use ;
// Hydrogen requires a type that implements `hydrogen::Stream`.
// We'll implement it atop the `simple-stream` crate.
// The following will be our server that handles all reported events
;
Author
Nathan Sizemore, nathanrsizemore@gmail.com
License
hydrogen is available under the MPL-2.0 license. See the LICENSE file for more info.