ServerGatewayApis

Trait ServerGatewayApis 

Source
pub trait ServerGatewayApis {
    // Required methods
    fn start_workflow<'life0, 'async_trait>(
        &'life0 self,
        namespace: String,
        task_queue: String,
        workflow_id: String,
        workflow_type: String,
    ) -> Pin<Box<dyn Future<Output = Result<StartWorkflowExecutionResponse, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn poll_workflow_task<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<PollWorkflowTaskQueueResponse, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn poll_activity_task<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<PollActivityTaskQueueResponse, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn complete_workflow_task<'life0, 'async_trait>(
        &'life0 self,
        task_token: Vec<u8>,
        commands: Vec<Command>,
    ) -> Pin<Box<dyn Future<Output = Result<RespondWorkflowTaskCompletedResponse, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn complete_activity_task<'life0, 'async_trait>(
        &'life0 self,
        task_token: Vec<u8>,
        result: Option<Payloads>,
    ) -> Pin<Box<dyn Future<Output = Result<RespondActivityTaskCompletedResponse, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn record_activity_heartbeat<'life0, 'async_trait>(
        &'life0 self,
        task_token: Vec<u8>,
        details: Option<Payloads>,
    ) -> Pin<Box<dyn Future<Output = Result<RecordActivityTaskHeartbeatResponse, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn cancel_activity_task<'life0, 'async_trait>(
        &'life0 self,
        task_token: Vec<u8>,
        details: Option<Payloads>,
    ) -> Pin<Box<dyn Future<Output = Result<RespondActivityTaskCanceledResponse, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn fail_activity_task<'life0, 'async_trait>(
        &'life0 self,
        task_token: Vec<u8>,
        failure: Option<Failure>,
    ) -> Pin<Box<dyn Future<Output = Result<RespondActivityTaskFailedResponse, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn fail_workflow_task<'life0, 'async_trait>(
        &'life0 self,
        task_token: Vec<u8>,
        cause: WorkflowTaskFailedCause,
        failure: Option<Failure>,
    ) -> Pin<Box<dyn Future<Output = Result<RespondWorkflowTaskFailedResponse, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn signal_workflow_execution<'life0, 'async_trait>(
        &'life0 self,
        workflow_id: String,
        run_id: String,
        signal_name: String,
        payloads: Option<Payloads>,
    ) -> Pin<Box<dyn Future<Output = Result<SignalWorkflowExecutionResponse, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

This trait provides ways to call the temporal server

Required Methods§

Source

fn start_workflow<'life0, 'async_trait>( &'life0 self, namespace: String, task_queue: String, workflow_id: String, workflow_type: String, ) -> Pin<Box<dyn Future<Output = Result<StartWorkflowExecutionResponse, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Starts workflow execution.

Source

fn poll_workflow_task<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<PollWorkflowTaskQueueResponse, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetch new workflow tasks. Should block indefinitely if there is no work.

Source

fn poll_activity_task<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<PollActivityTaskQueueResponse, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetch new activity tasks. Should block indefinitely if there is no work.

Source

fn complete_workflow_task<'life0, 'async_trait>( &'life0 self, task_token: Vec<u8>, commands: Vec<Command>, ) -> Pin<Box<dyn Future<Output = Result<RespondWorkflowTaskCompletedResponse, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Complete a workflow activation. task_token is the task token that would’ve been received from crate::Core::poll_workflow_task API. commands is a list of new commands to send to the server, such as starting a timer.

Source

fn complete_activity_task<'life0, 'async_trait>( &'life0 self, task_token: Vec<u8>, result: Option<Payloads>, ) -> Pin<Box<dyn Future<Output = Result<RespondActivityTaskCompletedResponse, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Complete activity task by sending response to the server. task_token contains activity identifier that would’ve been received from crate::Core::poll_activity_task API. result is a blob that contains activity response.

Source

fn record_activity_heartbeat<'life0, 'async_trait>( &'life0 self, task_token: Vec<u8>, details: Option<Payloads>, ) -> Pin<Box<dyn Future<Output = Result<RecordActivityTaskHeartbeatResponse, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Report activity task heartbeat by sending details to the server. task_token contains activity identifier that would’ve been received from crate::Core::poll_activity_task API. result contains cancel_requested flag, which if set to true indicates that activity has been cancelled.

Source

fn cancel_activity_task<'life0, 'async_trait>( &'life0 self, task_token: Vec<u8>, details: Option<Payloads>, ) -> Pin<Box<dyn Future<Output = Result<RespondActivityTaskCanceledResponse, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Cancel activity task by sending response to the server. task_token contains activity identifier that would’ve been received from crate::Core::poll_activity_task API. details is a blob that provides arbitrary user defined cancellation info.

Source

fn fail_activity_task<'life0, 'async_trait>( &'life0 self, task_token: Vec<u8>, failure: Option<Failure>, ) -> Pin<Box<dyn Future<Output = Result<RespondActivityTaskFailedResponse, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fail activity task by sending response to the server. task_token contains activity identifier that would’ve been received from crate::Core::poll_activity_task API. failure provides failure details, such as message, cause and stack trace.

Source

fn fail_workflow_task<'life0, 'async_trait>( &'life0 self, task_token: Vec<u8>, cause: WorkflowTaskFailedCause, failure: Option<Failure>, ) -> Pin<Box<dyn Future<Output = Result<RespondWorkflowTaskFailedResponse, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fail task by sending the failure to the server. task_token is the task token that would’ve been received from crate::Core::poll_workflow_task.

Source

fn signal_workflow_execution<'life0, 'async_trait>( &'life0 self, workflow_id: String, run_id: String, signal_name: String, payloads: Option<Payloads>, ) -> Pin<Box<dyn Future<Output = Result<SignalWorkflowExecutionResponse, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Send a signal to a certain workflow instance

Implementors§