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
Inspect(InspectCommand)
Inspect worker state
Shutdown
Shutdown the worker gracefully
Revoke
Revoke a task
Fields
RateLimit
Set rate limit for a task type
Fields
TimeLimit
Set time limit for a task type
Fields
AddConsumer
Add consumer for a queue
CancelConsumer
Cancel consumer for a queue
Queue(QueueCommand)
Queue control commands
BulkRevoke
Bulk revoke tasks
RevokeByPattern
Revoke tasks matching a pattern
Implementations§
Source§impl ControlCommand
impl ControlCommand
Sourcepub fn inspect_active() -> Self
pub fn inspect_active() -> Self
Create an inspect active command
Sourcepub fn inspect_scheduled() -> Self
pub fn inspect_scheduled() -> Self
Create an inspect scheduled command
Sourcepub fn inspect_reserved() -> Self
pub fn inspect_reserved() -> Self
Create an inspect reserved command
Sourcepub fn inspect_revoked() -> Self
pub fn inspect_revoked() -> Self
Create an inspect revoked command
Sourcepub fn inspect_registered() -> Self
pub fn inspect_registered() -> Self
Create an inspect registered command
Sourcepub fn inspect_stats() -> Self
pub fn inspect_stats() -> Self
Create an inspect stats command
Sourcepub fn inspect_queue_info() -> Self
pub fn inspect_queue_info() -> Self
Create an inspect queue info command
Sourcepub fn bulk_revoke(task_ids: Vec<Uuid>, terminate: bool) -> Self
pub fn bulk_revoke(task_ids: Vec<Uuid>, terminate: bool) -> Self
Create a bulk revoke command
Sourcepub fn revoke_by_pattern(pattern: impl Into<String>, terminate: bool) -> Self
pub fn revoke_by_pattern(pattern: impl Into<String>, terminate: bool) -> Self
Create a revoke by pattern command
Sourcepub fn queue_purge(queue: impl Into<String>) -> Self
pub fn queue_purge(queue: impl Into<String>) -> Self
Create a queue purge command
Sourcepub fn queue_length(queue: impl Into<String>) -> Self
pub fn queue_length(queue: impl Into<String>) -> Self
Create a queue length command
Sourcepub fn queue_delete(
queue: impl Into<String>,
if_empty: bool,
if_unused: bool,
) -> Self
pub fn queue_delete( queue: impl Into<String>, if_empty: bool, if_unused: bool, ) -> Self
Create a queue delete command
Sourcepub fn queue_bind(
queue: impl Into<String>,
exchange: impl Into<String>,
routing_key: impl Into<String>,
) -> Self
pub fn queue_bind( queue: impl Into<String>, exchange: impl Into<String>, routing_key: impl Into<String>, ) -> Self
Create a queue bind command
Trait Implementations§
Source§impl Clone for ControlCommand
impl Clone for ControlCommand
Source§fn clone(&self) -> ControlCommand
fn clone(&self) -> ControlCommand
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ControlCommand
impl Debug for ControlCommand
Source§impl<'de> Deserialize<'de> for ControlCommand
impl<'de> Deserialize<'de> for ControlCommand
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ControlCommand
impl RefUnwindSafe for ControlCommand
impl Send for ControlCommand
impl Sync for ControlCommand
impl Unpin for ControlCommand
impl UnwindSafe for ControlCommand
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
Mutably borrows from an owned value. Read more