pub trait Reactor {
    type Waker: Waker;

    fn new(
        shutdown: Receiver<()>,
        listening: Sender<SocketAddr>
    ) -> Result<Self, Error>; fn run<P, E>(
        &mut self,
        listen_addrs: &[SocketAddr],
        protocol: P,
        publisher: E,
        commands: Receiver<<P as Protocol>::Command>
    ) -> Result<(), Error>
    where
        P: Protocol,
        E: Publisher<<P as Protocol>::Event>,
        <P as Protocol>::DisconnectReason: Into<DisconnectReason<<P as Protocol>::DisconnectReason>>
; fn waker(&self) -> Self::Waker; }
Expand description

Any network reactor that can drive the light-client protocol.

Required Associated Types

The type of waker this reactor uses.

Required Methods

Create a new reactor, initializing it with a publisher for protocol events, a channel to receive commands, and a channel to shut it down.

Run the given protocol state machine with the reactor.

Return a new waker.

Implementations on Foreign Types

Construct a new reactor, given a channel to send events on.

Run the given protocol with the reactor.

Return a new waker.

Used to wake up the main event loop.

Implementors