File Coverage

blib/lib/Bot/Backbone/Service/Role/BareMetalChat.pm
Criterion Covered Total %
statement 5 5 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 7 7 100.0


line stmt bran cond sub pod time code
1             package Bot::Backbone::Service::Role::BareMetalChat;
2             $Bot::Backbone::Service::Role::BareMetalChat::VERSION = '0.161950';
3 4     4   2882 use v5.10;
  4         11  
4 4     4   16 use Moose::Role;
  4         7  
  4         30  
5              
6             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             default => sub { [] },
16             traits => [ 'Array' ],
17             handles => {
18             '_enqueue_message' => 'push',
19             #'_empty_message_queue' => [ map => sub { undef $_ } ],
20             '_empty_message_queue' => 'clear',
21             },
22             );
23              
24             after shutdown => sub {
25             my $self = shift;
26             for my $timer (@{ $self->_message_queue }) {
27             undef $timer;
28             }
29             $self->_message_queue([]);
30             #$self->_empty_message_queue;
31             };
32              
33             1;
34              
35             __END__
36              
37             =pod
38              
39             =encoding UTF-8
40              
41             =head1 NAME
42              
43             Bot::Backbone::Service::Role::BareMetalChat - A chat service that is bolted on to bare metal
44              
45             =head1 VERSION
46              
47             version 0.161950
48              
49             =head1 DESCRIPTION
50              
51             This role is nearly identical to L<Bot::Backbone::Service::Role::Chat>, but is
52             used to mark a chat service as one that will perform the final sending of a
53             message to an external service (e.g., L<Bot::Backbone::Service::JabberChat> or
54             L<Bot::Backbone::Service::ConsoleChat>) rather than one that just does some
55             internal routing (e.g., L<Bot::Backbone::Service::GroupChat> or
56             L<Bot::Backbone::Service::DirectChat>).
57              
58             =head1 AUTHOR
59              
60             Andrew Sterling Hanenkamp <hanenkamp@cpan.org>
61              
62             =head1 COPYRIGHT AND LICENSE
63              
64             This software is copyright (c) 2016 by Qubling Software LLC.
65              
66             This is free software; you can redistribute it and/or modify it under
67             the same terms as the Perl 5 programming language system itself.
68              
69             =cut