| 1 | package Langertha::Skeid::CapacityProbe::Custom; | ||||||||||
| 2 | 5 | our $VERSION = '0.004'; | |||||||||
| 3 | # ABSTRACT: Capacity probe backed by a caller-supplied callback | ||||||||||
| 4 | 5 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 5 | ▶ | use Carp qw(croak); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 5 | ▶ | use namespace::clean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 5 | extends 'Langertha::Skeid::CapacityProbe'; | |||||||||
| 9 | |||||||||||
| 10 | |||||||||||
| 11 | |||||||||||
| 12 | has code => ( | ||||||||||
| 13 | is => 'ro', | ||||||||||
| 14 | required => 1, | ||||||||||
| 15 | 17 | ▶ | isa => sub { croak 'custom capacity probe needs a coderef' unless ref($_[0]) eq 'CODE' }, | ||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=7.6
Branch: 1 branch
| |||||||||||
| 16 | 5 | ); | |||||||||
| 17 | |||||||||||
| 18 | |||||||||||
| 19 | 15 | ▶ | sub poll { | ||||||||
|
Subroutine
poll: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 20 | 15 | my ($self) = @_; | |||||||||
| 21 | 15 | return $self->code->($self); | |||||||||
| 22 | } | ||||||||||
| 23 | |||||||||||
| 24 | |||||||||||
| 25 | 5 | 1; | |||||||||
| 26 | |||||||||||
| 27 | __END__ | ||||||||||