Skip to main content

WorkerTaskService

Trait WorkerTaskService 

Source
pub trait WorkerTaskService:
    Send
    + Sync
    + 'static {
    type PollWorkerTaskStream: Stream<Item = Result<PollWorkerTaskResponse, Status>> + Send + 'static;

    // Required method
    fn poll_worker_task<'life0, 'async_trait>(
        &'life0 self,
        request: Request<Streaming<PollWorkerTaskRequest>>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Self::PollWorkerTaskStream>, 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 WorkerTaskServiceServer.

Required Associated Types§

Source

type PollWorkerTaskStream: Stream<Item = Result<PollWorkerTaskResponse, Status>> + Send + 'static

Server streaming response type for the PollWorkerTask method.

Required Methods§

Source

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

Exchanges registration, task, result, and control frames for a queue or a reserved execution slot. To stop taking work, a reserved-slot Worker cleanly half-closes an idle stream’s request side and keeps reading until Dex ends the stream. It drops tasks arriving after that decision and sends no frame at all for a dropped task: no rejection and no output. On a clean half-close of a reserved-slot stream, Dex treats a sent task without output as not delivered and dispatches it again with the same attempt number. A half-close of any other stream is still a disconnect. A Worker must send a started task’s final output before half-closing its stream. A transport error or reset instead means the Worker may have run the task.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§