Zing::Flow - Loop Step
Event-Loop Logic Chain
use Zing::Flow; my $flow = Zing::Flow->new(name => 'step_1', code => sub {1}); # $flow->execute;
This package provides represents an event-loop step, it is implemented as a simplified linked-list that allows other flows to be appended, prepended, and injected easily, anywhere in the flow.
This package uses type constraints from:
Zing::Types
This package has the following attributes:
code(CodeRef)
This attribute is read-only, accepts (CodeRef) values, and is required.
(CodeRef)
name(Str)
This attribute is read-only, accepts (Str) values, and is required.
(Str)
next(Flow)
This attribute is read-write, accepts (Flow) values, and is optional.
(Flow)
This package implements the following methods:
append(Flow $flow) : Flow
The append method appends the flow provided to the end of its chain.
# given: synopsis my $next = Zing::Flow->new(name => 'step_2', code => sub {2}); $flow->append($next);
bottom() : Flow
The bottom method returns the flow object at the end of its chain.
# given: synopsis $flow->bottom;
# given: synopsis my $next = Zing::Flow->new(name => 'step_2', code => sub {2}); $flow->next($next); $flow->bottom;
execute(Any @args) : Any
The execute method executes its code routine as a method call.
# given: synopsis $flow->execute;
prepend(Flow $flow) : Flow
The prepend method prepends the flow provided by adding itself to the end of that chain and returns the flow object provided.
# given: synopsis my $base = Zing::Flow->new(name => 'step_0', code => sub {0}); $flow->prepend($base);
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.