ry::Tiny;
use JSON;
# extends ...
extends 'Monitoring::Spooler::Web';
# has ...
has 'json' => (
'is' => 'ro',
'isa' => 'JSON',
'lazy' => 1,
'builder' => '_init_json',
);
# with
...
# initializers ...
sub _init_json {
my $self = shift;
my $JSON = JSON::->new()->utf8();
return $JSON;
}
sub _init_fields {
return [qw(mode group_id queue message)];
}
# your co
_ref = $self->json()->decode($queue);
} catch {
$self->logger()->log( message => 'Failed to decode JSON: '.$_, level => 'warning', );
};
$queue = undef;
# if json decoding abo