Skip to main content

EventKind

Enum EventKind 

Source
#[non_exhaustive]
pub enum EventKind {
Show 21 variants SubscriberPanicked, RuntimeFailure, SubscriberOverflow, ShutdownRequested, AllStoppedWithinGrace, GraceExceeded, AttemptStarting, AttemptSucceeded, AttemptCanceled, AttemptFailed, AttemptTimedOut, BackoffScheduled, TaskAddRequested, TaskAdded, TaskAddFailed, TaskRemoveRequested, TaskRemoved, TaskFinished, ControllerRejected, ControllerSubmitted, ControllerSlotTransition,
}
Expand description

Classifies one best-effort runtime event.

Every Event has seq, at, and kind. Variant documentation lists the additional metadata set by Taskvisor. Match on this value before reading optional metadata. This enum is non-exhaustive; include a wildcard arm when matching it.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

SubscriberPanicked

A subscriber callback panicked.

Carries the subscriber name in task and panic details in reason.

§

RuntimeFailure

An internal runtime component failed or did not join cleanly.

Carries the component name in task and diagnostic details in reason.

§

SubscriberOverflow

An event path fell behind or closed before delivery.

task identifies the subscriber or internal relay. dropped carries a loss count when known. reason contains diagnostic details.

§

ShutdownRequested

Explicit shutdown entered the shared shutdown workflow.

This includes a handle request, an application shutdown future, or a configured operating-system signal. Natural shutdown does not emit it.

§

AllStoppedWithinGrace

Registry task cleanup finished within the shared grace window.

A task force-aborted before this shutdown may still be physically active.

§

GraceExceeded

Registry task cleanup did not finish within the shared grace window.

§

AttemptStarting

A registered task is about to run one attempt.

Carries id, task, and the one-based attempt number.

§

AttemptSucceeded

One task attempt returned Ok(()).

This is not always the final task result. Carries id, task, attempt, and duration_ms.

§

AttemptCanceled

One task attempt returned TaskError::Canceled.

Carries id, task, attempt, and duration_ms.

§

AttemptFailed

One task attempt returned or produced a failure.

This includes retryable and fatal errors, task-returned timeouts, and caught task panics. A configured deadline normally emits AttemptTimedOut. Cleanup failure at that deadline emits this variant instead. Carries id, task, attempt, duration_ms, reason, and an optional exit_code.

§

AttemptTimedOut

One task attempt exceeded its configured deadline.

Carries id, task, attempt, timeout_ms, and duration_ms.

§

BackoffScheduled

The task actor scheduled a delay before another attempt.

Carries id, task, the previous attempt, delay_ms, and backoff_source. Failure backoff also carries the last error in reason.

§

TaskAddRequested

A task add request was published before registry processing.

This does not confirm admission. An all-or-nothing batch publishes one event per item before sending its single registry command. Carries the reserved id and requested task name.

§

TaskAdded

Registry admission accepted the task.

The task body may not have started. Carries id and task.

§

TaskAddFailed

Registry admission rejected a task add.

No rejected task body starts. Batch rejection starts no item in the batch. Carries id, task, diagnostic reason, TaskOutcomeKind::Rejected, and a registry RejectionKind.

§

TaskRemoveRequested

A remove or cancel request entered runtime or controller processing.

This is not proof that a target existed or reached terminal cleanup. Carries id, an optional reason, and a task name when available.

§

TaskRemoved

Registry cleanup attempted the closing event for a removed task.

Registry membership is already absent. Final watched-outcome delivery, when requested, was attempted first. A force-aborted task may still be physically active. Carries id and task.

§

TaskFinished

Registry cleanup classified the final outcome of a registered task.

Membership is already absent. This event is attempted before watched outcome delivery and TaskRemoved. Except for force-abort, task execution is physically joined first. Carries id, task, outcome_kind, and optional diagnostic reason and exit_code. Use TaskWaiter when the final outcome must not rely on best-effort event delivery.

§

ControllerRejected

Available on crate feature controller only.

The controller rejected a submission before registry admission.

Carries id, TaskOutcomeKind::Rejected, rejection_kind, diagnostic reason, and the slot name in task when known.

§

ControllerSubmitted

Available on crate feature controller only.

The controller accepted a submission into slot ownership or its queue.

Runtime registry admission and task execution may not have started. Carries id, the slot name in task, and a diagnostic summary in reason.

§

ControllerSlotTransition

Available on crate feature controller only.

A controller slot changed admission state.

Carries the slot name in task and diagnostic transition text in reason.

Implementations§

Source§

impl EventKind

Source

pub fn as_label(&self) -> &'static str

Returns the stable snake-case label for logs and metrics.

use taskvisor::EventKind;

assert_eq!(EventKind::AttemptStarting.as_label(), "attempt_starting");
assert_eq!(EventKind::BackoffScheduled.as_label(), "backoff_scheduled");

Trait Implementations§

Source§

impl Clone for EventKind

Source§

fn clone(&self) -> EventKind

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for EventKind

Source§

impl Debug for EventKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for EventKind

Source§

impl PartialEq for EventKind

Source§

fn eq(&self, other: &EventKind) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for EventKind

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more