Skip to main content

Master

Trait Master 

Source
pub trait Master:
    Send
    + Sync
    + 'static {
    type ControlStream: Stream<Item = Result<MasterMessage, Status>> + Send + 'static;
    type FetchInputsStream: Stream<Item = Result<InputChunk, Status>> + Send + 'static;

    // Required methods
    fn control<'life0, 'async_trait>(
        &'life0 self,
        request: Request<Streaming<WorkerMessage>>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Self::ControlStream>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn upload_parse_result<'life0, 'async_trait>(
        &'life0 self,
        request: Request<Streaming<ParseResultPart>>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<ParseResultAck>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn fetch_inputs<'life0, 'async_trait>(
        &'life0 self,
        request: Request<FetchInputsRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Self::FetchInputsStream>, 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 MasterServer.

Required Associated Types§

Source

type ControlStream: Stream<Item = Result<MasterMessage, Status>> + Send + 'static

Server streaming response type for the Control method.

Source

type FetchInputsStream: Stream<Item = Result<InputChunk, Status>> + Send + 'static

Server streaming response type for the FetchInputs method.

Required Methods§

Source

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

The long-lived control stream, one per worker. The first message is Register.

Source

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

A parse job’s result (bulky, so a call of its own rather than the control stream): a ParseResult header (no files), then one ParsedFile per message, so only one file’s size counts against the master’s message limit, not the root’s (B35).

Source

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

An attempt’s inputs when they are too big to travel inside AssignTask.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§