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 ping(reply_to: impl Into<String>) -> ControlCommand
pub fn ping(reply_to: impl Into<String>) -> ControlCommand
Create a ping command
Sourcepub fn inspect_active() -> ControlCommand
pub fn inspect_active() -> ControlCommand
Create an inspect active command
Sourcepub fn inspect_scheduled() -> ControlCommand
pub fn inspect_scheduled() -> ControlCommand
Create an inspect scheduled command
Sourcepub fn inspect_reserved() -> ControlCommand
pub fn inspect_reserved() -> ControlCommand
Create an inspect reserved command
Sourcepub fn inspect_revoked() -> ControlCommand
pub fn inspect_revoked() -> ControlCommand
Create an inspect revoked command
Sourcepub fn inspect_registered() -> ControlCommand
pub fn inspect_registered() -> ControlCommand
Create an inspect registered command
Sourcepub fn inspect_stats() -> ControlCommand
pub fn inspect_stats() -> ControlCommand
Create an inspect stats command
Sourcepub fn inspect_queue_info() -> ControlCommand
pub fn inspect_queue_info() -> ControlCommand
Create an inspect queue info command
Sourcepub fn shutdown(timeout: Option<u64>) -> ControlCommand
pub fn shutdown(timeout: Option<u64>) -> ControlCommand
Create a shutdown command
Sourcepub fn revoke(task_id: Uuid, terminate: bool) -> ControlCommand
pub fn revoke(task_id: Uuid, terminate: bool) -> ControlCommand
Create a revoke command
Sourcepub fn bulk_revoke(task_ids: Vec<Uuid>, terminate: bool) -> ControlCommand
pub fn bulk_revoke(task_ids: Vec<Uuid>, terminate: bool) -> ControlCommand
Create a bulk revoke command
Sourcepub fn revoke_by_pattern(
pattern: impl Into<String>,
terminate: bool,
) -> ControlCommand
pub fn revoke_by_pattern( pattern: impl Into<String>, terminate: bool, ) -> ControlCommand
Create a revoke by pattern command
Sourcepub fn queue_purge(queue: impl Into<String>) -> ControlCommand
pub fn queue_purge(queue: impl Into<String>) -> ControlCommand
Create a queue purge command
Sourcepub fn queue_length(queue: impl Into<String>) -> ControlCommand
pub fn queue_length(queue: impl Into<String>) -> ControlCommand
Create a queue length command
Sourcepub fn queue_delete(
queue: impl Into<String>,
if_empty: bool,
if_unused: bool,
) -> ControlCommand
pub fn queue_delete( queue: impl Into<String>, if_empty: bool, if_unused: bool, ) -> ControlCommand
Create a queue delete command
Sourcepub fn queue_bind(
queue: impl Into<String>,
exchange: impl Into<String>,
routing_key: impl Into<String>,
) -> ControlCommand
pub fn queue_bind( queue: impl Into<String>, exchange: impl Into<String>, routing_key: impl Into<String>, ) -> ControlCommand
Create a queue bind command
Sourcepub fn queue_unbind(
queue: impl Into<String>,
exchange: impl Into<String>,
routing_key: impl Into<String>,
) -> ControlCommand
pub fn queue_unbind( queue: impl Into<String>, exchange: impl Into<String>, routing_key: impl Into<String>, ) -> ControlCommand
Create a queue unbind command
Sourcepub fn queue_declare(
queue: impl Into<String>,
durable: bool,
exclusive: bool,
auto_delete: bool,
) -> ControlCommand
pub fn queue_declare( queue: impl Into<String>, durable: bool, exclusive: bool, auto_delete: bool, ) -> ControlCommand
Create a queue declare command
Trait Implementations§
Source§impl Clone for ControlCommand
impl Clone for ControlCommand
Source§fn clone(&self) -> ControlCommand
fn clone(&self) -> ControlCommand
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more