| 1 | package Net::RabbitFoot::Cmd::Command::purge_queue; | ||
| 2 | |||
| 3 | 1 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | extends qw(MooseX::App::Cmd::Command); | |
| 5 | 1 | with qw(Net::RabbitFoot::Cmd::Role::Config Net::RabbitFoot::Cmd::Role::Command); | |
| 6 | |||
| 7 | 1 | has queue => ( | |
| 8 | isa => 'Str', | ||
| 9 | is => 'rw', | ||
| 10 | required => 1, | ||
| 11 | metaclass => 'MooseX::Getopt::Meta::Attribute', | ||
| 12 | cmd_aliases => 'q', | ||
| 13 | documentation => 'queue name', | ||
| 14 | ); | ||
| 15 | |||
| 16 | 1 | __PACKAGE__->meta->make_immutable; | |
| 17 | 1 | ▶ | no Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 18 | |||
| 19 | 0 | ▶ | sub abstract { |
|
Subroutine
abstract: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 20 | 0 | return 'purge a queue'; | |
| 21 | } | ||
| 22 | |||
| 23 | 0 | ▶ | sub _validate_queue { |
|
Subroutine
_validate_queue: not called CC=1 SCAR=6.9
| |||
| 24 | 0 | my ($self,) = @_; | |
| 25 | |||
| 26 | 0 | $self->_check_queue(); | |
| 27 | 0 | return; | |
| 28 | } | ||
| 29 | |||
| 30 | 0 | ▶ | sub _run { |
|
Subroutine
_run: not called CC=1 SCAR=6.9
| |||
| 31 | 0 | my ($self, $client, $opt, $args,) = @_; | |
| 32 | |||
| 33 | 0 | my $method_frame = $client->purge_queue(queue => $self->queue)->method_frame; | |
| 34 | |||
| 35 | 0 | print 'Purged queue', "\n"; | |
| 36 | 0 | print 'message_count: ', $method_frame->message_count, "\n"; | |
| 37 | 0 | return; | |
| 38 | } | ||
| 39 | |||
| 40 | 1 | 1; | |
| 41 | |||