Skip to main content

ControlService

Trait ControlService 

Source
pub trait ControlService:
    Send
    + Sync
    + 'static {
    type WaitForTasksStream: Stream<Item = Result<Task, Status>> + Send + 'static;

    // Required methods
    fn register_http_server<'life0, 'async_trait>(
        &'life0 self,
        request: Request<RegisterHttpServerRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<RegisterHttpServerResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn register_event_handler<'life0, 'async_trait>(
        &'life0 self,
        request: Request<RegisterEventHandlerRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<RegisterEventHandlerResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn wait_for_tasks<'life0, 'async_trait>(
        &'life0 self,
        request: Request<WaitForTasksRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Self::WaitForTasksStream>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn send_task_result<'life0, 'async_trait>(
        &'life0 self,
        request: Request<SendTaskResultRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<SendTaskResultResponse>, 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 ControlServiceServer.

Required Associated Types§

Source

type WaitForTasksStream: Stream<Item = Result<Task, Status>> + Send + 'static

Server streaming response type for the WaitForTasks method.

Required Methods§

Source

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

App registers that it has an HTTP server listening on a port

Source

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

App registers an event handler for a specific resource

Source

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

App waits for tasks - this is a server-streaming RPC Worker runtime sends tasks as they arrive; the app processes them.

Source

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

App sends result for a processed task

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§