| 1 | package Punk::Command::Queue; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use 5.010; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 1 | ▶ | use Punk::Command (); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 1 | ▶ | use Punk::Queue::Command (); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 1 | our $VERSION = '0.11'; | |||||||||
| 10 | |||||||||||
| 11 | # The seam bin/punk probes on an unknown command: loading this module is the | ||||||||||
| 12 | # registration. `punk queue X ...` forwards raw argv to the punk-queue | ||||||||||
| 13 | # dispatcher, so the two spellings are the same CLI - one option surface, | ||||||||||
| 14 | # one help, byte-identical output. | ||||||||||
| 15 | |||||||||||
| 16 | Punk::Command->register(queue => { | ||||||||||
| 17 | abstract => 'the job queue (punk-queue)', | ||||||||||
| 18 | display => 'queue <command>', | ||||||||||
| 19 | usage => '<command> [options]', | ||||||||||
| 20 | desc => 'Everything bin/punk-queue does - worker, enqueue, jobs, ' | ||||||||||
| 21 | . "stats, crons, locks,\nmigrate and the rest - reached as a " | ||||||||||
| 22 | . 'punk subcommand.', | ||||||||||
| 23 | raw => 1, | ||||||||||
| 24 | 7 | ▶ | code => sub { | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 25 | 7 | my (undef, @argv) = @_; | |||||||||
| 26 | 7 | return Punk::Queue::Command::main(@argv); | |||||||||
| 27 | }, | ||||||||||
| 28 | 1 | ▶ | }, __PACKAGE__) if Punk::Command->can('register'); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 29 | |||||||||||
| 30 | 0 | ▶ | Punk::Command->register_doctor('Punk::Queue' => sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 31 | 0 | require Punk::Queue; | |||||||||
| 32 | 0 | return (1, $Punk::Queue::VERSION); | |||||||||
| 33 | 1 | ▶ | }, __PACKAGE__) if Punk::Command->can('register_doctor'); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 34 | |||||||||||
| 35 | 1 | 1; | |||||||||
| 36 | |||||||||||
| 37 | __END__ | ||||||||||