Class: Falqon::CLI::Kill

Inherits:
Base
  • Object
show all
Defined in:
lib/falqon/cli/kill.rb

Overview

Kill messages in a queue

Killing a message removes it from the pending or scheduled queue, and moves it to the dead queue.

Usage:

falqon kill -q, --queue=QUEUE

Options:

-q, --queue=QUEUE                                           # Queue name
    [--pending], [--no-pending], [--skip-pending]           # Kill only pending messages (default)
    [--processing], [--no-processing], [--skip-processing]  # Kill only processing messages
    [--head=N]                                              # Kill N messages from head of queue
    [--tail=N]                                              # Kill N messages from tail of queue
    [--index=N]                                             # Kill message at index N
    [--range=N M]                                           # Kill messages at index N to M
    [--id=N]                                                # Kill message with ID N

Examples:

Kill all messages in the queue (by default only pending messages are killed)

$ falqon kill --queue jobs
Killed 10 messages from queue jobs

Kill only pending messages

$ falqon kill --queue jobs --pending
Killed 10 pending messages from queue jobs

Kill only processing messages

$ falqon kill --queue jobs --processing
Killed 1 processing message from queue jobs

Kill only scheduled messages

$ falqon kill --queue jobs --scheduled
Killed 1 scheduled message from queue jobs

Kill first 5 messages

$ falqon kill --queue jobs --head 5
Killed 5 messages from queue jobs

Kill last 5 messages

$ falqon kill --queue jobs --tail 5
Killed 5 messages from queue jobs

Kill message at index 5

$ falqon kill --queue jobs --index 3 --index 5
Killed 1 message from queue jobs

Kill messages from index 5 to 10

$ falqon kill --queue jobs --range 5 10
Killed 6 messages from queue jobs

Kill message with ID 5

$ falqon kill --queue jobs --id 5 --id 1
Killed 2 messages from queue jobs