pub struct SimpleMux<P: IOProtocol> { /* private fields */ }
Expand description
Simple server implementation that creates one AF_INET/SOCK_STREAM socket and uses it to bind/listen at the specified address. It instantiates one epoll to accept new connections and one instance per cpu left to perform I/O.
TODO rename to something more interesting TODO think about how to support request pipelining
Events are handled synchronously TODO explain why useful for RPC or protocols that support request/message pipelining
New connections are load balanced from the connections epoll to the rest in a round-robin fashion.
Implementations§
Source§impl<P> SimpleMux<P>where
P: IOProtocol,
impl<P> SimpleMux<P>where
P: IOProtocol,
pub fn new(config: SimpleMuxConfig, protocol: P) -> Result<SimpleMux<P>>
Trait Implementations§
Source§impl<P> Drop for SimpleMux<P>where
P: IOProtocol,
impl<P> Drop for SimpleMux<P>where
P: IOProtocol,
Source§impl<P> Handler<EpollEvent> for SimpleMux<P>where
P: IOProtocol,
impl<P> Handler<EpollEvent> for SimpleMux<P>where
P: IOProtocol,
fn is_terminated(&self) -> bool
fn ready(&mut self, _: &EpollEvent)
Auto Trait Implementations§
impl<P> Freeze for SimpleMux<P>where
P: Freeze,
impl<P> RefUnwindSafe for SimpleMux<P>where
P: RefUnwindSafe,
impl<P> Send for SimpleMux<P>
impl<P> Sync for SimpleMux<P>where
P: Sync,
impl<P> Unpin for SimpleMux<P>where
P: Unpin,
impl<P> UnwindSafe for SimpleMux<P>where
P: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more