pub struct TaskAssignment {
pub task_id: String,
pub context: Option<TaskContext>,
pub heartbeat_interval_secs: u32,
pub task: Option<Task>,
}Expand description
A task dispatched to a worker for execution or discovery.
For queue-based transports (NATS JetStream, etc.), workers should acknowledge the queue message immediately upon receipt — before calling TaskHeartbeat or executing the component. The orchestrator is the single source of truth for task lifecycle; queue-level redelivery would conflict with the orchestrator’s timeout and retry tracking. See the ack semantics documentation in the NATS transport.
Fields§
§task_id: StringUnique ID for this task assignment. Used to correlate completion reports with assignments.
context: Option<TaskContext>Per-task context for worker callbacks (CompleteTask, SubmitRun, etc.). Contains the orchestrator URL that owns the current run.
heartbeat_interval_secs: u32Suggested heartbeat interval in seconds. The worker should send TaskHeartbeat at this cadence after calling TaskHeartbeat. The orchestrator uses a 5s crash-detection timeout — if no heartbeat or CompleteTask arrives within 5s, the task is treated as failed. 0 means no heartbeating required.
task: Option<Task>The task to perform — either a component execution or a discovery request.
Trait Implementations§
Source§impl Clone for TaskAssignment
impl Clone for TaskAssignment
Source§fn clone(&self) -> TaskAssignment
fn clone(&self) -> TaskAssignment
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TaskAssignment
impl Debug for TaskAssignment
Source§impl Default for TaskAssignment
impl Default for TaskAssignment
Source§impl<'de> Deserialize<'de> for TaskAssignment
impl<'de> Deserialize<'de> for TaskAssignment
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Message for TaskAssignment
impl Message for TaskAssignment
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.Source§impl PartialEq for TaskAssignment
impl PartialEq for TaskAssignment
Source§impl Serialize for TaskAssignment
impl Serialize for TaskAssignment
impl StructuralPartialEq for TaskAssignment
Auto Trait Implementations§
impl Freeze for TaskAssignment
impl RefUnwindSafe for TaskAssignment
impl Send for TaskAssignment
impl Sync for TaskAssignment
impl Unpin for TaskAssignment
impl UnsafeUnpin for TaskAssignment
impl UnwindSafe for TaskAssignment
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> 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