async fn handle_error(&mut self, context: &mut ServiceContext, error: ServiceError) {
        log::info!("service error: {:?}", error);
        if let ServiceError::DialerError { address, error: _ } = error {
            // Reconnect in a newly spawned task so that we don't block the whole tentacle service.
            let control = context.control().clone();
            tokio::spawn(async move {
                tokio::time::sleep(RECONNECT_DURATION).await;
                log::info!("dial {}", address);
                let _ = control.dial(address, TargetProtocol::All).await;
            });
        }
    }
// A lot of internal error events will be output here, but not all errors need to close the service,
// some just tell users that they need to pay attention
A lot of internal error events will be output here, but not all errors need to close the service,
some just tell users that they need to pay attention
A lot of internal error events will be output here but not all errors need to close the service some just tell users that they need to pay attention
async fn handle_error(&mut self, context: &mut ServiceContext, error: ServiceError) {
        log::info!("service error: {:?}", error);
        if let ServiceError::DialerError { address, error: _ } = error {
            // Reconnect in a newly spawned task so that we don't block the whole tentacle service.
            let control = context.control().clone();
            tokio::spawn(async move {
                tokio::time::sleep(RECONNECT_DURATION).await;
                log::info!("dial {}", address);
                let _ = control.dial(address, TargetProtocol::All).await;
            });
        }
    }
async fn handle_error ( & mut self , context : & mut ServiceContext , error : ServiceError ) { log :: info ! ( " " error ) ; if let ServiceError :: DialerError { address , error : _ } = error { // Reconnect in a newly spawned task so that we don't block the whole tentacle service. let control = context . control ( ) . clone ( ) ; tokio :: spawn ( async move { tokio :: time :: sleep ( RECONNECT_DURATION ) . await ; log :: info ! ( " " address ) ; let _ = control . dial ( address , TargetProtocol :: All ) . await ; } ) ; } }
A lot of internal error events will be output here, but not all errors need to close the service,
some just tell users that they need to pay attention
A lot of internal error events will be output here but not all errors need to close the service some just tell users that they need to pay attention
&mut self
context
&mut ServiceContext
error
ServiceError
&mut self
context
&mut ServiceContext
error
ServiceError