| 1 | package Zing::Simple; | ||
| 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 | extends 'Zing::Process'; | ||
| 14 | |||
| 15 | use Zing::Logic::Simple; | ||
| 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::Simple->new(debug => $debug, process => $self) | ||
| 24 | } | ||
| 25 | |||
| 26 | 1; | ||
| 27 | |||
| 28 | =encoding utf8 | ||
| 29 | |||
| 30 | =head1 NAME | ||
| 31 | |||
| 32 | Zing::Simple - Simple Process | ||
| 33 | |||
| 34 | =cut | ||
| 35 | |||
| 36 | =head1 ABSTRACT | ||
| 37 | |||
| 38 | Simple Process | ||
| 39 | |||
| 40 | =cut | ||
| 41 | |||
| 42 | =head1 SYNOPSIS | ||
| 43 | |||
| 44 | package MyApp; | ||
| 45 | |||
| 46 | use parent 'Zing::Simple'; | ||
| 47 | |||
| 48 | sub perform { | ||
| 49 | time; | ||
| 50 | } | ||
| 51 | |||
| 52 | package main; | ||
| 53 | |||
| 54 | my $myapp = MyApp->new; | ||
| 55 | |||
| 56 | # $myapp->execute; | ||
| 57 | |||
| 58 | =cut | ||
| 59 | |||
| 60 | =head1 DESCRIPTION | ||
| 61 | |||
| 62 | This package provides a L<Zing::Process> which ignores its mailbox and only | ||
| 63 | invokes its C<perform> method. | ||
| 64 | |||
| 65 | =cut | ||
| 66 | |||
| 67 | =head1 INHERITS | ||
| 68 | |||
| 69 | This package inherits behaviors from: | ||
| 70 | |||
| 71 | L<Zing::Process> | ||
| 72 | |||
| 73 | =cut | ||
| 74 | |||
| 75 | =head1 LIBRARIES | ||
| 76 | |||
| 77 | This package uses type constraints from: | ||
| 78 | |||
| 79 | L<Zing::Types> | ||
| 80 | |||
| 81 | =cut | ||
| 82 | |||
| 83 | =head1 SCENARIOS | ||
| 84 | |||
| 85 | This package supports the following scenarios: | ||
| 86 | |||
| 87 | =cut | ||
| 88 | |||
| 89 | =head2 perform | ||
| 90 | |||
| 91 | # given: synopsis | ||
| 92 | |||
| 93 | $myapp->perform; | ||
| 94 | |||
| 95 | The perform method is meant to be implemented by a subclass and is | ||
| 96 | automatically invoked iteratively by the event-loop. | ||
| 97 | |||
| 98 | =cut | ||
| 99 | |||
| 100 | =head1 AUTHOR | ||
| 101 | |||
| 102 | Al Newkirk, C<awncorp@cpan.org> | ||
| 103 | |||
| 104 | =head1 LICENSE | ||
| 105 | |||
| 106 | Copyright (C) 2011-2019, Al Newkirk, et al. | ||
| 107 | |||
| 108 | This is free software; you can redistribute it and/or modify it under the terms | ||
| 109 | of the The Apache License, Version 2.0, as elucidated in the L<"license | ||
| 110 | file"|https://github.com/iamalnewkirk/zing/blob/master/LICENSE>. | ||
| 111 | |||
| 112 | =head1 PROJECT | ||
| 113 | |||
| 114 | L<Wiki|https://github.com/iamalnewkirk/zing/wiki> | ||
| 115 | |||
| 116 | L<Project|https://github.com/iamalnewkirk/zing> | ||
| 117 | |||
| 118 | L<Initiatives|https://github.com/iamalnewkirk/zing/projects> | ||
| 119 | |||
| 120 | L<Milestones|https://github.com/iamalnewkirk/zing/milestones> | ||
| 121 | |||
| 122 | L<Contributing|https://github.com/iamalnewkirk/zing/blob/master/CONTRIBUTE.md> | ||
| 123 | |||
| 124 | L<Issues|https://github.com/iamalnewkirk/zing/issues> | ||
| 125 | |||
| 126 | =cut |