pub struct AsyncActivityHandle<CT> { /* private fields */ }Expand description
Handle for completing activities asynchronously (outside the worker).
Implementations§
Source§impl<CT> AsyncActivityHandle<CT>
impl<CT> AsyncActivityHandle<CT>
Sourcepub fn new(client: CT, identifier: ActivityIdentifier) -> Self
pub fn new(client: CT, identifier: ActivityIdentifier) -> Self
Create a new async activity handle.
Sourcepub fn identifier(&self) -> &ActivityIdentifier
pub fn identifier(&self) -> &ActivityIdentifier
Get the identifier for this activity.
Source§impl<CT: WorkflowService + NamespacedClient + Clone> AsyncActivityHandle<CT>
impl<CT: WorkflowService + NamespacedClient + Clone> AsyncActivityHandle<CT>
Sourcepub async fn complete(
&self,
result: Option<Payloads>,
) -> Result<(), AsyncActivityError>
pub async fn complete( &self, result: Option<Payloads>, ) -> Result<(), AsyncActivityError>
Complete the activity with a successful result.
Sourcepub async fn fail(
&self,
failure: Failure,
last_heartbeat_details: Option<Payloads>,
) -> Result<(), AsyncActivityError>
pub async fn fail( &self, failure: Failure, last_heartbeat_details: Option<Payloads>, ) -> Result<(), AsyncActivityError>
Fail the activity with a failure.
Sourcepub async fn report_cancelation(
&self,
details: Option<Payloads>,
) -> Result<(), AsyncActivityError>
pub async fn report_cancelation( &self, details: Option<Payloads>, ) -> Result<(), AsyncActivityError>
Reports the activity as canceled.
Sourcepub async fn heartbeat(
&self,
details: Option<Payloads>,
) -> Result<ActivityHeartbeatResponse, AsyncActivityError>
pub async fn heartbeat( &self, details: Option<Payloads>, ) -> Result<ActivityHeartbeatResponse, AsyncActivityError>
Record a heartbeat for the activity.
Heartbeats let the server know the activity is still running and can carry progress information. The response indicates if cancellation has been requested.
Auto Trait Implementations§
impl<CT> Freeze for AsyncActivityHandle<CT>where
CT: Freeze,
impl<CT> RefUnwindSafe for AsyncActivityHandle<CT>where
CT: RefUnwindSafe,
impl<CT> Send for AsyncActivityHandle<CT>where
CT: Send,
impl<CT> Sync for AsyncActivityHandle<CT>where
CT: Sync,
impl<CT> Unpin for AsyncActivityHandle<CT>where
CT: Unpin,
impl<CT> UnsafeUnpin for AsyncActivityHandle<CT>where
CT: UnsafeUnpin,
impl<CT> UnwindSafe for AsyncActivityHandle<CT>where
CT: 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> 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