warm_channels 0.3.0

Always-ready HTTP client channels for gRPC or other RPC-like requests.
Documentation
//! Miscellaneous utilities for warm_channels.

use futures::Stream;

/// A no-op health checker that probes nothing and returns always healthy.
#[derive(Debug)]
pub struct AssumeAlwaysHealthy;

impl Default for AssumeAlwaysHealthy {
    fn default() -> Self {
        Self
    }
}

impl<B> crate::HealthChecker<B> for AssumeAlwaysHealthy {
    type Error = std::convert::Infallible;

    fn watch<S, RespBody>(&self, _svc: S) -> impl Stream<Item = Result<(), Self::Error>> {
        futures::stream::once(futures::future::ready(Ok(())))
    }
}