pub struct TaskIndex(/* private fields */);Expand description
O(1) lookup table from TaskId to per-node metadata.
Built once via TaskIndex::build at workflow construction. Stored behind
an Arc on Workflow and shared with
anything that needs to resolve TaskId → name / timeout / priority / tags
on the dispatch hot path.
Implementations§
Source§impl TaskIndex
impl TaskIndex
Sourcepub fn build(continuation: &WorkflowContinuation) -> Self
pub fn build(continuation: &WorkflowContinuation) -> Self
Build the index by walking continuation once and hashing each Task
node’s id to its TaskId.
Sourcepub fn get(&self, task_id: &TaskId) -> Option<&TaskNodeMetadata>
pub fn get(&self, task_id: &TaskId) -> Option<&TaskNodeMetadata>
Borrow the metadata for task_id.
Sourcepub fn name(&self, task_id: &TaskId) -> Option<&Arc<str>>
pub fn name(&self, task_id: &TaskId) -> Option<&Arc<str>>
Human-readable node id for task_id, if any.
Sourcepub fn priority(&self, task_id: &TaskId) -> Option<u8>
pub fn priority(&self, task_id: &TaskId) -> Option<u8>
Look up the priority configured on task_id.
Sourcepub fn timeout(&self, task_id: &TaskId) -> Option<Duration>
pub fn timeout(&self, task_id: &TaskId) -> Option<Duration>
Look up the timeout configured on task_id.
Look up the affinity tags configured on task_id.
Returns a borrow into the index — callers that need to own the tags
clone explicitly (e.g. when feeding into TaskHint::new).
Sourcepub fn retry_policy(&self, task_id: &TaskId) -> Option<&RetryPolicy>
pub fn retry_policy(&self, task_id: &TaskId) -> Option<&RetryPolicy>
Look up the retry policy configured on task_id.
Sourcepub fn build_task_metadata(&self, task_id: &TaskId) -> TaskMetadata
pub fn build_task_metadata(&self, task_id: &TaskId) -> TaskMetadata
Build a TaskMetadata from the indexed
fields. Equivalent to
WorkflowContinuation::build_task_metadata
but O(1) instead of O(N) tree walk + per-node SHA-256.