pub struct ActivityContext {
pub task_id: String,
pub activity_attempt_id: String,
pub lease_owner: String,
pub activity_type: String,
pub attempt_number: u64,
pub task_queue: String,
pub worker_id: String,
/* private fields */
}Fields§
§task_id: String§activity_attempt_id: String§lease_owner: String§activity_type: String§attempt_number: u64§task_queue: String§worker_id: StringImplementations§
Source§impl ActivityContext
impl ActivityContext
Sourcepub fn worker_session(&self) -> Option<&WorkerSession>
pub fn worker_session(&self) -> Option<&WorkerSession>
Session affinity and holder-local lifecycle for this remote activity.
Source§impl ActivityContext
impl ActivityContext
Sourcepub fn heartbeat_resume_version(&self) -> Option<u64>
pub fn heartbeat_resume_version(&self) -> Option<u64>
Negotiated resume contract version for this claim; unavailable is None.
This is not a checkpoint write sequence.
Sourcepub fn last_heartbeat_checkpoint(
&self,
) -> Result<Option<&ActivityHeartbeatCheckpoint>, ActivityHeartbeatResumeUnavailable>
pub fn last_heartbeat_checkpoint( &self, ) -> Result<Option<&ActivityHeartbeatCheckpoint>, ActivityHeartbeatResumeUnavailable>
The read-only acknowledged checkpoint supplied by this claim.
Ok(None) means the supported claim explicitly has no checkpoint.
Err(ActivityHeartbeatResumeUnavailable) means the v1 contract was not
supplied. Inline local activities and Server-free tests are unavailable.
Heartbeat writes never change this received snapshot. Acknowledgement
does not atomically commit an external business effect.
Sourcepub fn last_heartbeat_details(
&self,
) -> Result<Option<&Value>, ActivityHeartbeatResumeUnavailable>
pub fn last_heartbeat_details( &self, ) -> Result<Option<&Value>, ActivityHeartbeatResumeUnavailable>
Last acknowledged details, with unavailable distinct from no checkpoint.
Sourcepub fn last_heartbeat_at(
&self,
) -> Result<Option<&DateTime<Utc>>, ActivityHeartbeatResumeUnavailable>
pub fn last_heartbeat_at( &self, ) -> Result<Option<&DateTime<Utc>>, ActivityHeartbeatResumeUnavailable>
Producer acknowledgement time, with full fractional precision.
Sourcepub fn activity_execution_id(&self) -> Option<&str>
pub fn activity_execution_id(&self) -> Option<&str>
Logical Server activity execution ID, stable across that activity’s retries.
This is the received claim identity, including for worker-session activities. It is unavailable when an older Server omits it, for inline local activities before the Server records their command, and in Server-free tests. It is never derived from a per-attempt task or attempt ID. Use an application business key when this value is unavailable.
Sourcepub fn workflow_id(&self) -> Option<&str>
pub fn workflow_id(&self) -> Option<&str>
Owning workflow instance ID from the claim (or parent local workflow task).
Older claims and Server-free activity tests can report None.
Sourcepub fn run_id(&self) -> Option<&str>
pub fn run_id(&self) -> Option<&str>
Owning workflow run ID from the claim (or parent local workflow task).
Older claims and Server-free activity tests can report None.
Sourcepub fn retry_info(&self) -> &ActivityRetryInfo
pub fn retry_info(&self) -> &ActivityRetryInfo
Immutable original attempt identity and received retry policy.
pub async fn heartbeat<T: Serialize>( &self, details: T, ) -> Result<ActivityHeartbeatResponse>
Trait Implementations§
Source§impl Clone for ActivityContext
impl Clone for ActivityContext
Source§fn clone(&self) -> ActivityContext
fn clone(&self) -> ActivityContext
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more