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>,
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>,
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>,
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>,
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>,
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>,
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>,
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>,
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 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 async fn fetch_history(
&self,
opts: WorkflowFetchHistoryOptions,
) -> Result<WorkflowHistory, WorkflowInteractionError>where
CT: NamespacedClient,
pub async fn fetch_history(
&self,
opts: WorkflowFetchHistoryOptions,
) -> Result<WorkflowHistory, WorkflowInteractionError>where
CT: NamespacedClient,
Fetch workflow execution history.
Trait Implementations§
Source§impl<ClientT: Clone, W: Clone> Clone for WorkflowHandle<ClientT, W>
impl<ClientT: Clone, W: Clone> Clone for WorkflowHandle<ClientT, W>
Source§fn clone(&self) -> WorkflowHandle<ClientT, W>
fn clone(&self) -> WorkflowHandle<ClientT, W>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<ClientT, W> Freeze for WorkflowHandle<ClientT, W>where
ClientT: Freeze,
impl<ClientT, W> RefUnwindSafe for WorkflowHandle<ClientT, W>where
ClientT: RefUnwindSafe,
W: RefUnwindSafe,
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>where
ClientT: UnsafeUnpin,
impl<ClientT, W> UnwindSafe for WorkflowHandle<ClientT, W>where
ClientT: UnwindSafe,
W: UnwindSafe,
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
Mutably borrows from an owned value. Read more
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>
Wrap the input message
T in a tonic::Request