Zing/Watcher.pm untested

filter: Statementstmt 0.0% 0 / 26 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 7 Podpod n/a totaltotal 0.0% 0 / 33 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package Zing::Watcher;
2  
3 use 5.014;
4  
5 use strict;
6 use warnings;
7  
8 use registry 'Zing::Types';
9 use routines;
10  
11 use Data::Object::Class;
12  
13 use Zing::Logic::Watcher;
14  
15 extends 'Zing::Process';
16  
17 our $VERSION = '0.26'; # VERSION
18  
19 # BUILDERS
20  
21 fun new_logic($self) {
22 my $debug = $self->env->debug;
23 Zing::Logic::Watcher->new(debug => $debug, process => $self)
24 }
25  
26 1;
27  
28 =encoding utf8
29  
30 =head1 NAME
31  
32 Zing::Watcher - Watcher Process
33  
34 =cut
35  
36 =head1 ABSTRACT
37  
38 Watcher Process
39  
40 =cut
41  
42 =head1 SYNOPSIS
43  
44 package MyApp;
45  
46 use parent 'Zing::Watcher';
47  
48 sub perform {
49 time;
50 }
51  
52 sub receive {
53 my ($self, $from, $data) = @_;
54  
55 [$from, $data];
56 }
57  
58 sub scheme {
59 ['MyApp::Handler', [], 1];
60 }
61  
62 package main;
63  
64 my $myapp = MyApp->new;
65  
66 # $myapp->execute;
67  
68 =cut
69  
70 =head1 DESCRIPTION
71  
72 This package provides a L<Zing::Process> which forks a C<scheme> using
73 L<Zong::Fork> and maintains the desired active processes. The standard process
74 C<perform> and C<receive> methods operate as expected.
75  
76 =cut
77  
78 =head1 INHERITS
79  
80 This package inherits behaviors from:
81  
82 L<Zing::Process>
83  
84 =cut
85  
86 =head1 LIBRARIES
87  
88 This package uses type constraints from:
89  
90 L<Zing::Types>
91  
92 =cut
93  
94 =head1 SCENARIOS
95  
96 This package supports the following scenarios:
97  
98 =cut
99  
100 =head2 perform
101  
102 # given: synopsis
103  
104 $myapp->perform;
105  
106 The perform method is meant to be implemented by a subclass and is
107 automatically invoked iteratively by the event-loop.
108  
109 =cut
110  
111 =head2 receive
112  
113 # given: synopsis
114  
115 $myapp->receive($myapp->name, { status => 'ok' });
116  
117 The receive method is meant to be implemented by a subclass and is
118 automatically invoked iteratively by the event-loop.
119  
120 =cut
121  
122 =head2 scheme
123  
124 # given: synopsis
125  
126 $myapp->scheme;
127  
128 The scheme method is meant to be implemented by a subclass and is
129 automatically invoked when the process is executed.
130  
131 =cut
132  
133 =head1 AUTHOR
134  
135 Al Newkirk, C<awncorp@cpan.org>
136  
137 =head1 LICENSE
138  
139 Copyright (C) 2011-2019, Al Newkirk, et al.
140  
141 This is free software; you can redistribute it and/or modify it under the terms
142 of the The Apache License, Version 2.0, as elucidated in the L<"license
143 file"|https://github.com/iamalnewkirk/zing/blob/master/LICENSE>.
144  
145 =head1 PROJECT
146  
147 L<Wiki|https://github.com/iamalnewkirk/zing/wiki>
148  
149 L<Project|https://github.com/iamalnewkirk/zing>
150  
151 L<Initiatives|https://github.com/iamalnewkirk/zing/projects>
152  
153 L<Milestones|https://github.com/iamalnewkirk/zing/milestones>
154  
155 L<Contributing|https://github.com/iamalnewkirk/zing/blob/master/CONTRIBUTE.md>
156  
157 L<Issues|https://github.com/iamalnewkirk/zing/issues>
158  
159 =cut