pub struct WorkflowInterceptorContext { /* private fields */ }Expand description
Workflow execution context available to async-capable inbound interceptors.
Implementations§
Source§impl WorkflowInterceptorContext
impl WorkflowInterceptorContext
Sourcepub fn workflow_id(&self) -> &str
pub fn workflow_id(&self) -> &str
Return the workflow’s unique identifier.
Sourcepub fn task_queue(&self) -> &str
pub fn task_queue(&self) -> &str
Return the task queue the workflow is executing in.
Sourcepub fn workflow_type(&self) -> &str
pub fn workflow_type(&self) -> &str
Return the workflow type name.
Sourcepub fn workflow_time(&self) -> Option<SystemTime>
pub fn workflow_time(&self) -> Option<SystemTime>
Return the current time according to the workflow.
Sourcepub fn history_length(&self) -> u32
pub fn history_length(&self) -> u32
Return the length of history so far at this point in the workflow.
Sourcepub fn search_attributes(&self) -> SearchAttributes
pub fn search_attributes(&self) -> SearchAttributes
Return current values for workflow search attributes.
Sourcepub fn is_replaying(&self) -> bool
pub fn is_replaying(&self) -> bool
Returns true if the workflow is replaying (including during queries and update validators), false otherwise.
Sourcepub fn is_replaying_history_events(&self) -> bool
pub fn is_replaying_history_events(&self) -> bool
Return true if the workflow is replaying history events (excluding queries and update validators), false otherwise.
Sourcepub fn payload_converter(&self) -> &PayloadConverter
pub fn payload_converter(&self) -> &PayloadConverter
Returns the payload converter used by the worker running this workflow.
Sourcepub fn timer<T>(&self, opts: T) -> impl CancellableFuture<TimerResult> + use<T>where
T: Into<TimerOptions>,
pub fn timer<T>(&self, opts: T) -> impl CancellableFuture<TimerResult> + use<T>where
T: Into<TimerOptions>,
Request to create a timer through the workflow outbound interceptor chain.
Sourcepub fn execute_activity<AD>(
&self,
activity: AD,
input: impl Into<<AD as ActivityDefinition>::Input>,
opts: ActivityOptions,
) -> impl CancellableFuture<Result<<AD as ActivityDefinition>::Output, ActivityExecutionError>>
pub fn execute_activity<AD>( &self, activity: AD, input: impl Into<<AD as ActivityDefinition>::Input>, opts: ActivityOptions, ) -> impl CancellableFuture<Result<<AD as ActivityDefinition>::Output, ActivityExecutionError>>
Request to run an activity through the workflow outbound interceptor chain.
Sourcepub fn execute_local_activity<AD>(
&self,
activity: AD,
input: impl Into<<AD as ActivityDefinition>::Input>,
opts: LocalActivityOptions,
) -> impl CancellableFuture<Result<<AD as ActivityDefinition>::Output, ActivityExecutionError>>
pub fn execute_local_activity<AD>( &self, activity: AD, input: impl Into<<AD as ActivityDefinition>::Input>, opts: LocalActivityOptions, ) -> impl CancellableFuture<Result<<AD as ActivityDefinition>::Output, ActivityExecutionError>>
Request to run a local activity through the workflow outbound interceptor chain.
Sourcepub fn start_child_workflow<WD>(
&self,
workflow: WD,
input: impl Into<<WD as WorkflowDefinition>::Input>,
opts: ChildWorkflowOptions,
) -> impl CancellableFutureWithReason<Result<StartedChildWorkflow<WD>, ChildWorkflowStartError>>
pub fn start_child_workflow<WD>( &self, workflow: WD, input: impl Into<<WD as WorkflowDefinition>::Input>, opts: ChildWorkflowOptions, ) -> impl CancellableFutureWithReason<Result<StartedChildWorkflow<WD>, ChildWorkflowStartError>>
Start a child workflow through the workflow outbound interceptor chain.
Sourcepub fn external_workflow(
&self,
workflow_id: impl Into<String>,
run_id: Option<String>,
) -> ExternalWorkflowHandle
pub fn external_workflow( &self, workflow_id: impl Into<String>, run_id: Option<String>, ) -> ExternalWorkflowHandle
Get a handle to an external workflow for signaling or requesting cancellation.
Sourcepub fn start_nexus_operation(
&self,
opts: NexusOperationOptions,
) -> impl CancellableFuture<Result<StartedNexusOperation, Failure>>
pub fn start_nexus_operation( &self, opts: NexusOperationOptions, ) -> impl CancellableFuture<Result<StartedNexusOperation, Failure>>
Start a Nexus operation through the workflow outbound interceptor chain.
Trait Implementations§
Source§impl Clone for WorkflowInterceptorContext
impl Clone for WorkflowInterceptorContext
Source§fn clone(&self) -> WorkflowInterceptorContext
fn clone(&self) -> WorkflowInterceptorContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for WorkflowInterceptorContext
impl !Send for WorkflowInterceptorContext
impl !Sync for WorkflowInterceptorContext
impl !UnwindSafe for WorkflowInterceptorContext
impl Freeze for WorkflowInterceptorContext
impl Unpin for WorkflowInterceptorContext
impl UnsafeUnpin for WorkflowInterceptorContext
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§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