risingwave_common_metrics::monitor::connection

Trait RouterExt

source
pub trait RouterExt<L> {
    // Required method
    fn monitored_serve_with_shutdown<ResBody>(
        self,
        _: SocketAddr,
        _: impl Into<String>,
        _: TcpConfig,
        _: impl Future<Output = ()>,
    ) -> impl Future<Output = ()>
       where L: Layer<Routes>,
             L::Service: Service<Request<BoxBody>, Response = Response<ResBody>> + Clone + Send + 'static,
             <<L as Layer<Routes>>::Service as Service<Request<BoxBody>>>::Future: Send + 'static,
             <<L as Layer<Routes>>::Service as Service<Request<BoxBody>>>::Error: Into<Box<dyn Error + Send + Sync>> + Send,
             ResBody: Body<Data = Bytes> + Send + 'static,
             ResBody::Error: Into<Box<dyn Error + Send + Sync>>;
}

Required Methods§

source

fn monitored_serve_with_shutdown<ResBody>( self, _: SocketAddr, _: impl Into<String>, _: TcpConfig, _: impl Future<Output = ()>, ) -> impl Future<Output = ()>
where L: Layer<Routes>, L::Service: Service<Request<BoxBody>, Response = Response<ResBody>> + Clone + Send + 'static, <<L as Layer<Routes>>::Service as Service<Request<BoxBody>>>::Future: Send + 'static, <<L as Layer<Routes>>::Service as Service<Request<BoxBody>>>::Error: Into<Box<dyn Error + Send + Sync>> + Send, ResBody: Body<Data = Bytes> + Send + 'static, ResBody::Error: Into<Box<dyn Error + Send + Sync>>,

Serve the given service while monitoring the connection.

Calling the function will first bind the given service to the given address. Awaiting the returned future will then start the server and keep it running until the given signal future resolves.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<L> RouterExt<L> for Router<L>

source§

fn monitored_serve_with_shutdown<ResBody>( self, listen_addr: SocketAddr, connection_type: impl Into<String>, config: TcpConfig, signal: impl Future<Output = ()>, ) -> impl Future<Output = ()>
where L: Layer<Routes>, L::Service: Service<Request<BoxBody>, Response = Response<ResBody>> + Clone + Send + 'static, <<L as Layer<Routes>>::Service as Service<Request<BoxBody>>>::Future: Send + 'static, <<L as Layer<Routes>>::Service as Service<Request<BoxBody>>>::Error: Into<Box<dyn Error + Send + Sync>> + Send, ResBody: Body<Data = Bytes> + Send + 'static, ResBody::Error: Into<Box<dyn Error + Send + Sync>>,

Implementors§