ПРИВЕТСТВИЕ SALUTE
Доброго всем! Доброго здоровья! Доброго духа!
Hello all! Nice health! Good thinks!
NAME
Loop::Flow::Object - запуск цикла для объекта с контролем и переключением ветвления (fork), выполнение кода в указанных методах объекта.
Loop::Flow::Object - looping code of one object with forking on/off. Simple switch and count of forks.
Executing code, control count and exit from loop by the object methods.
VERSION
Version 0.02
SYNOPSIS
use Loop::Flow::Object;
use Some::My::Module;
my $obj = Some::My::Module->new(...);
# no-no this is on Some/My/Module.pm !!
sub Some::My::Module::one {# main code in loop
my $self = shift;
my @data = @_;
...
}
# no-no this is on Some/My/Module.pm !!
sub Some::My::Module::data {# data for main code in loop
my $self = shift;
my $count = shift;
...
}
my $loop = Loop::Flow::Object->new(max_count=>..., forks=>..., debug=>...);
$loop->start($obj, main=>'one', data=>'data', end=>'...',);
...
EXPORT
None.
METHODS
new(max_count=>..., forks=>..., debug=>...)
Options:
max_count => <integer> (optional)
infinitely looping if max_count => 0 || undef (default)
forks => <integer> (optional)
Limit of forks No forking, sequentially if forks => 0 || undef (default)
debug => 0|1 (optional)
0 - no print msg (default)
start($obj, main=>'<main_method>', data=>'<data_method>', end=>'<end_method>',)
Looping/forking for $obj which have methods:
main => string '<main_method>' - main code which execute in loop (as child process if forks) (mandatory)
data => string '<data_method>' - hook which get/return data for '<main_method>'
Attention. If you define this method and it's return empty list - WILL STOPS THE LOOPING?, but will wait for childs if any.
end => string '<end_method>' - hook which execute when end the '<main_method>' of one loop (child process exit if forks)
AUTHOR
Mikhail Che, <m.che at aukama.dyndns.org>
BUGS
Please report any bugs or feature requests to bug-loop-flow at rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Loop-Flow. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Loop::Flow::Object
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
Search CPAN
ACKNOWLEDGEMENTS
LICENSE AND COPYRIGHT
Copyright 2012 Mikhail Che.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 207:
You forgot a '=back' before '=head1'