Trait PolarisGrpc

Source
pub trait PolarisGrpc:
    Send
    + Sync
    + 'static {
    type DiscoverStream: Stream<Item = Result<DiscoverResponse, Status>> + Send + 'static;

    // Required methods
    fn report_client<'life0, 'async_trait>(
        &'life0 self,
        request: Request<Client>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn register_instance<'life0, 'async_trait>(
        &'life0 self,
        request: Request<Instance>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn deregister_instance<'life0, 'async_trait>(
        &'life0 self,
        request: Request<Instance>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn discover<'life0, 'async_trait>(
        &'life0 self,
        request: Request<Streaming<DiscoverRequest>>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Self::DiscoverStream>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn heartbeat<'life0, 'async_trait>(
        &'life0 self,
        request: Request<Instance>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Generated trait containing gRPC methods that should be implemented for use with PolarisGrpcServer.

Required Associated Types§

Source

type DiscoverStream: Stream<Item = Result<DiscoverResponse, Status>> + Send + 'static

Server streaming response type for the Discover method.

Required Methods§

Source

fn report_client<'life0, 'async_trait>( &'life0 self, request: Request<Client>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

客户端上报

Source

fn register_instance<'life0, 'async_trait>( &'life0 self, request: Request<Instance>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

被调方注册服务实例

Source

fn deregister_instance<'life0, 'async_trait>( &'life0 self, request: Request<Instance>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

被调方反注册服务实例

Source

fn discover<'life0, 'async_trait>( &'life0 self, request: Request<Streaming<DiscoverRequest>>, ) -> Pin<Box<dyn Future<Output = Result<Response<Self::DiscoverStream>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

统一发现接口

Source

fn heartbeat<'life0, 'async_trait>( &'life0 self, request: Request<Instance>, ) -> Pin<Box<dyn Future<Output = Result<Response<Response>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

被调方上报心跳

Implementors§