ControlCommand

Enum ControlCommand 

Source
pub enum ControlCommand {
    Ping {
        reply_to: String,
    },
    Inspect(InspectCommand),
    Shutdown {
        timeout: Option<u64>,
    },
    Revoke {
        task_id: Uuid,
        terminate: bool,
        signal: Option<String>,
    },
    RateLimit {
        task_name: String,
        rate: Option<f64>,
    },
    TimeLimit {
        task_name: String,
        soft: Option<u64>,
        hard: Option<u64>,
    },
    AddConsumer {
        queue: String,
    },
    CancelConsumer {
        queue: String,
    },
    Queue(QueueCommand),
    BulkRevoke {
        task_ids: Vec<Uuid>,
        terminate: bool,
    },
    RevokeByPattern {
        pattern: String,
        terminate: bool,
    },
}
Expand description

Control commands that can be sent to workers

Variants§

§

Ping

Ping the worker to check if it’s alive

Fields

§reply_to: String

Unique ID for this ping request

§

Inspect(InspectCommand)

Inspect worker state

§

Shutdown

Shutdown the worker gracefully

Fields

§timeout: Option<u64>

Optional timeout in seconds

§

Revoke

Revoke a task

Fields

§task_id: Uuid

Task ID to revoke

§terminate: bool

Whether to terminate the task if already running

§signal: Option<String>

Whether to send SIGKILL (true) or SIGTERM (false)

§

RateLimit

Set rate limit for a task type

Fields

§task_name: String

Task name to rate limit

§rate: Option<f64>

Maximum tasks per second (None to remove limit)

§

TimeLimit

Set time limit for a task type

Fields

§task_name: String

Task name to limit

§soft: Option<u64>

Soft time limit in seconds (warning)

§hard: Option<u64>

Hard time limit in seconds (kill)

§

AddConsumer

Add consumer for a queue

Fields

§queue: String

Queue name to consume from

§

CancelConsumer

Cancel consumer for a queue

Fields

§queue: String

Queue name to stop consuming

§

Queue(QueueCommand)

Queue control commands

§

BulkRevoke

Bulk revoke tasks

Fields

§task_ids: Vec<Uuid>

Task IDs to revoke

§terminate: bool

Whether to terminate running tasks

§

RevokeByPattern

Revoke tasks matching a pattern

Fields

§pattern: String

Pattern to match task names (glob format)

§terminate: bool

Whether to terminate running tasks

Implementations§

Source§

impl ControlCommand

Source

pub fn ping(reply_to: impl Into<String>) -> Self

Create a ping command

Source

pub fn inspect_active() -> Self

Create an inspect active command

Source

pub fn inspect_scheduled() -> Self

Create an inspect scheduled command

Source

pub fn inspect_reserved() -> Self

Create an inspect reserved command

Source

pub fn inspect_revoked() -> Self

Create an inspect revoked command

Source

pub fn inspect_registered() -> Self

Create an inspect registered command

Source

pub fn inspect_stats() -> Self

Create an inspect stats command

Source

pub fn inspect_queue_info() -> Self

Create an inspect queue info command

Source

pub fn shutdown(timeout: Option<u64>) -> Self

Create a shutdown command

Source

pub fn revoke(task_id: Uuid, terminate: bool) -> Self

Create a revoke command

Source

pub fn bulk_revoke(task_ids: Vec<Uuid>, terminate: bool) -> Self

Create a bulk revoke command

Source

pub fn revoke_by_pattern(pattern: impl Into<String>, terminate: bool) -> Self

Create a revoke by pattern command

Source

pub fn queue_purge(queue: impl Into<String>) -> Self

Create a queue purge command

Source

pub fn queue_length(queue: impl Into<String>) -> Self

Create a queue length command

Source

pub fn queue_delete( queue: impl Into<String>, if_empty: bool, if_unused: bool, ) -> Self

Create a queue delete command

Source

pub fn queue_bind( queue: impl Into<String>, exchange: impl Into<String>, routing_key: impl Into<String>, ) -> Self

Create a queue bind command

Source

pub fn queue_unbind( queue: impl Into<String>, exchange: impl Into<String>, routing_key: impl Into<String>, ) -> Self

Create a queue unbind command

Source

pub fn queue_declare( queue: impl Into<String>, durable: bool, exclusive: bool, auto_delete: bool, ) -> Self

Create a queue declare command

Trait Implementations§

Source§

impl Clone for ControlCommand

Source§

fn clone(&self) -> ControlCommand

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ControlCommand

Source§

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

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

impl<'de> Deserialize<'de> for ControlCommand

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for ControlCommand

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,