Trait rabble::ServiceHandler [] [src]

pub trait ServiceHandler<T> {
    fn handle_envelope(
        &mut self,
        _: &Node<T>,
        _: Envelope<T>,
        _: &Registrar
    ) -> Result<()>; fn init(&mut self, &Registrar, &Node<T>) -> Result<()> { ... } fn handle_notification(
        &mut self,
        &Node<T>,
        Notification,
        &Registrar
    ) -> Result<()> { ... } }

A service handler

Required Methods

Handle any envelopes addressed to the service's Pid. All handlers must implement this function.

Provided Methods

A callback function used to initialize the handler.

The handler is expected to register any necessary timeouts or listening sockets with the poller and send any initialization messages via the Node. Some handlers may not need any initialization, so this callback is optional.

Handle poll notifications. Some handler don't register anything that requires notification and only receive envelopes. Those handlers do not need to implement this function.

Implementors