| 1 | package Bot::Backbone::Service::Role::BareMetalChat; | ||
| 2 | 4 | $Bot::Backbone::Service::Role::BareMetalChat::VERSION = '0.161950'; | |
| 3 | 4 | ▶ | use v5.10; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 4 | ▶ | use Moose::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 4 | with 'Bot::Backbone::Service::Role::Chat'; | |
| 7 | |||
| 8 | # ABSTRACT: A chat service that is bolted on to bare metal | ||
| 9 | |||
| 10 | |||
| 11 | has _message_queue => ( | ||
| 12 | is => 'rw', | ||
| 13 | isa => 'ArrayRef', | ||
| 14 | required => 1, | ||
| 15 | 6 | ▶ | default => sub { [] }, |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 16 | 4 | traits => [ 'Array' ], | |
| 17 | handles => { | ||
| 18 | '_enqueue_message' => 'push', | ||
| 19 | #'_empty_message_queue' => [ map => sub { undef $_ } ], | ||
| 20 | '_empty_message_queue' => 'clear', | ||
| 21 | }, | ||
| 22 | ); | ||
| 23 | |||
| 24 | 3 | ▶ | after shutdown => sub { |
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
| |||
| 25 | 3 | my $self = shift; | |
| 26 | 3 | for my $timer (@{ $self->_message_queue }) { | |
| 27 | 298 | undef $timer; | |
| 28 | } | ||
| 29 | 3 | $self->_message_queue([]); | |
| 30 | #$self->_empty_message_queue; | ||
| 31 | 4 | }; | |
| 32 | |||
| 33 | 4 | 1; | |
| 34 | |||
| 35 | __END__ | ||