pub trait Scheduler: Send + Sync + 'static {
    type AnnouncePeerStream: Stream<Item = Result<AnnouncePeerResponse, Status>> + Send + 'static;
    type SyncProbesStream: Stream<Item = Result<SyncProbesResponse, Status>> + Send + 'static;

    // Required methods
    fn announce_peer<'life0, 'async_trait>(
        &'life0 self,
        request: Request<Streaming<AnnouncePeerRequest>>
    ) -> Pin<Box<dyn Future<Output = Result<Response<Self::AnnouncePeerStream>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn stat_peer<'life0, 'async_trait>(
        &'life0 self,
        request: Request<StatPeerRequest>
    ) -> Pin<Box<dyn Future<Output = Result<Response<Peer>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn leave_peer<'life0, 'async_trait>(
        &'life0 self,
        request: Request<LeavePeerRequest>
    ) -> Pin<Box<dyn Future<Output = Result<Response<()>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn exchange_peer<'life0, 'async_trait>(
        &'life0 self,
        request: Request<ExchangePeerRequest>
    ) -> Pin<Box<dyn Future<Output = Result<Response<ExchangePeerResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn stat_task<'life0, 'async_trait>(
        &'life0 self,
        request: Request<StatTaskRequest>
    ) -> Pin<Box<dyn Future<Output = Result<Response<Task>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn announce_host<'life0, 'async_trait>(
        &'life0 self,
        request: Request<AnnounceHostRequest>
    ) -> Pin<Box<dyn Future<Output = Result<Response<()>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn leave_host<'life0, 'async_trait>(
        &'life0 self,
        request: Request<LeaveHostRequest>
    ) -> Pin<Box<dyn Future<Output = Result<Response<()>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn sync_probes<'life0, 'async_trait>(
        &'life0 self,
        request: Request<Streaming<SyncProbesRequest>>
    ) -> Pin<Box<dyn Future<Output = Result<Response<Self::SyncProbesStream>, 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 SchedulerServer.

Required Associated Types§

source

type AnnouncePeerStream: Stream<Item = Result<AnnouncePeerResponse, Status>> + Send + 'static

Server streaming response type for the AnnouncePeer method.

source

type SyncProbesStream: Stream<Item = Result<SyncProbesResponse, Status>> + Send + 'static

Server streaming response type for the SyncProbes method.

Required Methods§

source

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

AnnouncePeer announces peer to scheduler.

source

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

Checks information of peer.

source

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

LeavePeer releases peer in scheduler.

source

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

TODO exchange peer api definition. ExchangePeer exchanges peer information.

source

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

Checks information of task.

source

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

AnnounceHost announces host to scheduler.

source

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

LeaveHost releases host in scheduler.

source

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

SyncProbes sync probes of the host.

Implementors§