pub struct WorkflowHandle<ClientT, W> { /* private fields */ }Expand description
A workflow handle which can refer to a specific workflow run, or a chain of workflow runs with the same workflow id.
Implementations§
Source§impl<CT, W> WorkflowHandle<CT, W>
impl<CT, W> WorkflowHandle<CT, W>
Source§impl<CT, W> WorkflowHandle<CT, W>
impl<CT, W> WorkflowHandle<CT, W>
Sourcepub fn new(client: CT, info: WorkflowExecutionInfo) -> Self
pub fn new(client: CT, info: WorkflowExecutionInfo) -> Self
Create a workflow handle from a client and identifying information.
Sourcepub fn info(&self) -> &WorkflowExecutionInfo
pub fn info(&self) -> &WorkflowExecutionInfo
Get the workflow execution info
Sourcepub async fn get_result(
&self,
opts: WorkflowGetResultOptions,
) -> Result<W::Output, WorkflowGetResultError>
pub async fn get_result( &self, opts: WorkflowGetResultOptions, ) -> Result<W::Output, WorkflowGetResultError>
Await the result of the workflow execution
Sourcepub async fn signal<S>(
&self,
signal: S,
input: S::Input,
opts: WorkflowSignalOptions,
) -> Result<(), WorkflowInteractionError>where
CT: WorkflowService + NamespacedClient + Clone,
S: SignalDefinition<Workflow = W::Run>,
S::Input: Send,
pub async fn signal<S>(
&self,
signal: S,
input: S::Input,
opts: WorkflowSignalOptions,
) -> Result<(), WorkflowInteractionError>where
CT: WorkflowService + NamespacedClient + Clone,
S: SignalDefinition<Workflow = W::Run>,
S::Input: Send,
Send a signal to the workflow
Sourcepub async fn query<Q>(
&self,
query: Q,
input: Q::Input,
opts: WorkflowQueryOptions,
) -> Result<Q::Output, WorkflowQueryError>where
CT: WorkflowService + NamespacedClient + Clone,
Q: QueryDefinition<Workflow = W::Run>,
Q::Input: Send,
pub async fn query<Q>(
&self,
query: Q,
input: Q::Input,
opts: WorkflowQueryOptions,
) -> Result<Q::Output, WorkflowQueryError>where
CT: WorkflowService + NamespacedClient + Clone,
Q: QueryDefinition<Workflow = W::Run>,
Q::Input: Send,
Query the workflow
Sourcepub async fn execute_update<U>(
&self,
update: U,
input: U::Input,
options: WorkflowExecuteUpdateOptions,
) -> Result<U::Output, WorkflowUpdateError>where
CT: WorkflowService + NamespacedClient + Clone,
U: UpdateDefinition<Workflow = W::Run>,
U::Input: Send,
U::Output: 'static,
pub async fn execute_update<U>(
&self,
update: U,
input: U::Input,
options: WorkflowExecuteUpdateOptions,
) -> Result<U::Output, WorkflowUpdateError>where
CT: WorkflowService + NamespacedClient + Clone,
U: UpdateDefinition<Workflow = W::Run>,
U::Input: Send,
U::Output: 'static,
Send an update to the workflow and wait for it to complete, returning the result.
Sourcepub async fn start_update<U>(
&self,
update: U,
input: U::Input,
options: WorkflowStartUpdateOptions,
) -> Result<WorkflowUpdateHandle<CT, U::Output>, WorkflowUpdateError>where
CT: WorkflowService + NamespacedClient + Clone,
U: UpdateDefinition<Workflow = W::Run>,
U::Input: Send,
pub async fn start_update<U>(
&self,
update: U,
input: U::Input,
options: WorkflowStartUpdateOptions,
) -> Result<WorkflowUpdateHandle<CT, U::Output>, WorkflowUpdateError>where
CT: WorkflowService + NamespacedClient + Clone,
U: UpdateDefinition<Workflow = W::Run>,
U::Input: Send,
Start an update and return a handle without waiting for completion.
Use execute_update() if you want to wait for the result immediately.
Sourcepub fn get_update_handle<U>(
&self,
update: U,
update_id: impl Into<String>,
) -> WorkflowUpdateHandle<CT, U::Output>where
U: UpdateDefinition<Workflow = W::Run>,
pub fn get_update_handle<U>(
&self,
update: U,
update_id: impl Into<String>,
) -> WorkflowUpdateHandle<CT, U::Output>where
U: UpdateDefinition<Workflow = W::Run>,
Get a handle to an existing update.
The update definition determines the result type. The returned handle uses this workflow
handle’s workflow and run IDs and does not validate the update ID until
get_result is called.
Sourcepub async fn cancel(
&self,
opts: WorkflowCancelOptions,
) -> Result<(), WorkflowInteractionError>where
CT: NamespacedClient,
pub async fn cancel(
&self,
opts: WorkflowCancelOptions,
) -> Result<(), WorkflowInteractionError>where
CT: NamespacedClient,
Request cancellation of this workflow.
Sourcepub async fn terminate(
&self,
opts: WorkflowTerminateOptions,
) -> Result<(), WorkflowInteractionError>where
CT: NamespacedClient,
pub async fn terminate(
&self,
opts: WorkflowTerminateOptions,
) -> Result<(), WorkflowInteractionError>where
CT: NamespacedClient,
Terminate this workflow.
Sourcepub async fn describe(
&self,
opts: WorkflowDescribeOptions,
) -> Result<WorkflowExecutionDescription, WorkflowInteractionError>where
CT: NamespacedClient,
pub async fn describe(
&self,
opts: WorkflowDescribeOptions,
) -> Result<WorkflowExecutionDescription, WorkflowInteractionError>where
CT: NamespacedClient,
Get workflow execution description/metadata.
Sourcepub fn fetch_history(
&self,
opts: WorkflowFetchHistoryOptions,
) -> WorkflowHistorywhere
CT: NamespacedClient + 'static,
pub fn fetch_history(
&self,
opts: WorkflowFetchHistoryOptions,
) -> WorkflowHistorywhere
CT: NamespacedClient + 'static,
Fetch workflow execution history as a lazy stream.
No request is sent until the returned stream is polled.
Trait Implementations§
Auto Trait Implementations§
impl<ClientT, W> Freeze for WorkflowHandle<ClientT, W>
impl<ClientT, W> RefUnwindSafe for WorkflowHandle<ClientT, W>
impl<ClientT, W> Send for WorkflowHandle<ClientT, W>
impl<ClientT, W> Sync for WorkflowHandle<ClientT, W>
impl<ClientT, W> Unpin for WorkflowHandle<ClientT, W>
impl<ClientT, W> UnsafeUnpin for WorkflowHandle<ClientT, W>
impl<ClientT, W> UnwindSafe for WorkflowHandle<ClientT, W>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request