File Coverage

blib/lib/App/EventStreamr/Internal/API.pm
Criterion Covered Total %
statement 21 21 100.0
branch 2 4 50.0
condition n/a
subroutine 8 8 100.0
pod n/a
total 31 33 93.9


line stmt bran cond sub pod time code
1             package App::EventStreamr::Internal::API;
2 1     1   22839 use Method::Signatures;
  1         89148  
  1         8  
3 1     1   417 use FindBin '$Bin';
  1         2  
  1         125  
4 1     1   948 use Moo;
  1         7010  
  1         6  
5 1     1   2052 use namespace::clean;
  1         3992  
  1         4  
6              
7             # ABSTRACT: An EventStreamr API Process
8              
9             our $VERSION = '0.5'; # VERSION: Generated by DZP::OurPkg:Version
10              
11              
12             extends 'App::EventStreamr::Process';
13              
14             has 'cmd' => ( is => 'ro', default => sub { "plackup -s Twiggy -p 3000 $Bin/eventstreamr-api.pl --daemon --environment production" } );
15             has 'cmd_regex' => ( is => 'ro', default => sub { "\\/bin\\/plackup.*" } );
16             has 'id' => ( is => 'ro', default => sub { 'api' } );
17             has 'type' => ( is => 'ro', default => sub { 'internal' } );
18              
19             # We're special, we should always be running
20 1 50   1   1498 method _run() {
  1     1   3  
  1         4  
21 1         8 $self->{config}{control}{$self->{id}}{run} = 1;
22 1         11 return 1;
23             }
24              
25             # And we shouldn't be restarted
26 1 50   1   552 method _restart() {
  1     1   2  
  1         5  
27 1         9 return 0;
28             }
29              
30             1;
31              
32             __END__
33              
34             =pod
35              
36             =encoding UTF-8
37              
38             =head1 NAME
39              
40             App::EventStreamr::Internal::API - An EventStreamr API Process
41              
42             =head1 VERSION
43              
44             version 0.5
45              
46             =head1 SYNOPSIS
47              
48             This manages the internal EventStreamr API
49              
50             =head1 DESCRIPTION
51              
52             This largely extends L<App::EventStreamr::Process>, provides
53             default cmds that can be overridden in the configuration.
54              
55             =head1 AUTHOR
56              
57             Leon Wright < techman@cpan.org >
58              
59             =head1 COPYRIGHT AND LICENSE
60              
61             This software is Copyright (c) 2014 by Leon Wright.
62              
63             This is free software, licensed under:
64              
65             The GNU Affero General Public License, Version 3, November 2007
66              
67             =cut