Zing/Watcher.pm untested

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