| 1 | package NgxQueue; | ||||||||||
| 2 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | 1 | our $VERSION = '0.02'; | |||||||||
| 6 | |||||||||||
| 7 | # load backend (XS or PP) | ||||||||||
| 8 | 1 | my $use_xs = 0; | |||||||||
| 9 | 1 | ▶ | if (!exists $INC{'NgxQueue/PP.pm'}) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 10 | 1 | my $pp = $ENV{PERL_ONLY}; | |||||||||
| 11 | 1 | ▶ | if (!$pp) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 12 | 0 | eval qq{ | |||||||||
| 13 | require XSLoader; | ||||||||||
| 14 | XSLoader::load __PACKAGE__, $VERSION; | ||||||||||
| 15 | }; | ||||||||||
| 16 | } | ||||||||||
| 17 | 1 | ▶ | if (__PACKAGE__->can('new')) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | 0 | $use_xs = 1; | |||||||||
| 19 | } | ||||||||||
| 20 | else { | ||||||||||
| 21 | 1 | require 'NgxQueue/PP.pm'; | |||||||||
| 22 | 1 | push @NgxQueue::ISA, 'NgxQueue::PP'; | |||||||||
| 23 | } | ||||||||||
| 24 | } | ||||||||||
| 25 | 1 | ▶ | sub BACKEND() { $use_xs ? 'XS' : 'PP' } | ||||||||
|
Subroutine
BACKEND: called CC=2 SCAR=7.6
Pod
documented
Branch: 1 branch
| |||||||||||
| 26 | |||||||||||
| 27 | 1 | 1; | |||||||||
| 28 | |||||||||||
| 29 | __END__ | ||||||||||