| 1 | package Exobrain::Agent::Run; | ||||||||||
| 2 | 1 | ▶ | use Moose::Role; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 1 | ▶ | use Method::Signatures; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use Try::Tiny; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | # ABSTRACT: Role for agents which run 'continously' | ||||||||||
| 7 | our $VERSION = '1.08'; # VERSION | ||||||||||
| 8 | |||||||||||
| 9 | with 'Exobrain::Agent'; | ||||||||||
| 10 | |||||||||||
| 11 | requires('run'); | ||||||||||
| 12 | excludes('poll'); | ||||||||||
| 13 | |||||||||||
| 14 | |||||||||||
| 15 | 0 | ▶ | method start() { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=4.1
Subroutine
start: not called CC=2 SCAR=16.1
Branch: 1 branch
| |||||||||||
| 16 | 0 | $self->run; | |||||||||
| 17 | |||||||||||
| 18 | 0 | my $class = ref($self); | |||||||||
| 19 | 0 | my $message = "Error: $class exited run() method unexpectedly."; | |||||||||
| 20 | |||||||||||
| 21 | 0 | ▶ | try { $self->exobrain->notify($message, priority => 1); }; | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 22 | |||||||||||
| 23 | 0 | die $message; | |||||||||
| 24 | |||||||||||
| 25 | } | ||||||||||
| 26 | |||||||||||
| 27 | 1; | ||||||||||
| 28 | |||||||||||
| 29 | __END__ | ||||||||||