pub fn health_check(metadata: ServiceMetadata,
                    check_result: HealthCheckResult,
                    execution: Option<Duration>) {
    if stream_initialized() {
        let check_result: types::HealthCheckResult = check_result.into();
        publish(HealthCheckEvent { service_metadata: Some(metadata),
                                   event_metadata:   None,
                                   result:           i32::from(check_result),
                                   execution:        execution.map(Duration::into), });
    }
}
// Takes metadata directly, rather than a `&Service` like other event
// functions, because of how the asynchronous health checking
// currently works. Revisit when async/await + Pin is all stabilized.
/// `execution` will be `Some` if the service had a hook to run, and
/// records how long it took that hook to execute completely.
Takes metadata directly, rather than a `&Service` like other event
functions, because of how the asynchronous health checking
currently works. Revisit when async/await + Pin is all stabilized.
`execution` will be `Some` if the service had a hook to run, and
records how long it took that hook to execute completely.
Takes metadata directly rather than a ` &Service ` like other event functions because of how the asynchronous health checking currently works . Revisit when async / await + Pin is all stabilized . ` execution ` will be ` Some ` if the service had a hook to run and records how long it took that hook to execute completely .
pub fn health_check(metadata: ServiceMetadata,
                    check_result: HealthCheckResult,
                    execution: Option<Duration>) {
    if stream_initialized() {
        let check_result: types::HealthCheckResult = check_result.into();
        publish(HealthCheckEvent { service_metadata: Some(metadata),
                                   event_metadata:   None,
                                   result:           i32::from(check_result),
                                   execution:        execution.map(Duration::into), });
    }
}
pub fn health_check ( metadata : ServiceMetadata , check_result : HealthCheckResult , execution : Option < Duration > ) { if stream_initialized ( ) { let check_result : types :: HealthCheckResult = check_result . into ( ) ; publish ( HealthCheckEvent { service_metadata : Some ( metadata ) , event_metadata : None , result : i32 :: from ( check_result ) , execution : execution . map ( Duration :: into ) , } ) ; } }
Takes metadata directly, rather than a `&Service` like other event
functions, because of how the asynchronous health checking
currently works.
Takes metadata directly rather than a ` &Service ` like other event functions because of how the asynchronous health checking currently works .
metadata
ServiceMetadata
check_result
HealthCheckResult
execution
Option<Duration>
metadata
ServiceMetadata
check_result
HealthCheckResult
execution
Option<Duration>