Trait tentacle::traits::ServiceHandle [−][src]
pub trait ServiceHandle {
fn handle_error(
&mut self,
_control: &mut ServiceContext,
_error: ServiceError
) { ... }
fn handle_event(
&mut self,
_control: &mut ServiceContext,
_event: ServiceEvent
) { ... }
}
Expand description
Service handle
Note
All functions on this trait will block the entire server running, do not insert long-time tasks, you can use the futures task instead.
Behavior
The handle that exists when the Service is created.
Mainly handle some Service-level errors thrown at runtime, such as listening errors.
At the same time, the session establishment and disconnection messages will also be perceived here.
Provided methods
fn handle_error(&mut self, _control: &mut ServiceContext, _error: ServiceError)
fn handle_error(&mut self, _control: &mut ServiceContext, _error: ServiceError)
Handling runtime errors
fn handle_event(&mut self, _control: &mut ServiceContext, _event: ServiceEvent)
fn handle_event(&mut self, _control: &mut ServiceContext, _event: ServiceEvent)
Handling session establishment and disconnection events