Zing::Single - Single Process
Single Process
package MyApp; use parent 'Zing::Single'; sub perform { my ($self) = @_; time; } sub receive { my ($self, $from, $data) = @_; [$from, $data]; } package main; my $myapp = MyApp->new; # $myapp->execute;
This package provides a Zing::Process which runs once and shuts-down, but otherwise operates as a typical process and invokes its receive and perform methods.
receive
perform
This package inherits behaviors from:
Zing::Process
This package uses type constraints from:
Zing::Types
This package supports the following scenarios:
# given: synopsis $myapp->perform;
The perform method is meant to be implemented by a subclass and is automatically invoked iteratively by the event-loop.
# given: synopsis $myapp->receive($myapp->name, { task => 'fuzzy_logic' });
The receive method is meant to be implemented by a subclass and is automatically invoked iteratively by the event-loop whenever a process receives a message in its mailbox.
Al Newkirk, awncorp@cpan.org
awncorp@cpan.org
Copyright (C) 2011-2019, Al Newkirk, et al.
This is free software; you can redistribute it and/or modify it under the terms of the The Apache License, Version 2.0, as elucidated in the "license file".
Wiki
Project
Initiatives
Milestones
Contributing
Issues
To install Zing, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Zing
CPAN shell
perl -MCPAN -e shell install Zing
For more information on module installation, please visit the detailed CPAN module installation guide.