Reflexive-Role-DataMover
view release on metacpan or search on metacpan
lib/Reflexive/Role/DataMover.pm view on Meta::CPAN
clearer => 'clear_'.$attr,
predicate => 'has_'.$attr,
);
}
with 'Reflexive::Role::DataMover';
=head1 DESCRIPTION
Reflexive::Role::DataMover is a composable behavior that provides functionality
for streaming data between two Reflex::Streams. It is a parameterized role, so
there is tons of configurability available, but the defaults should be sane
enough to avoid using most of it. See L</ROLE_PARAMTERS> for details.
Essentially what this role does is upon BUILD it watches the events out of each
of the handles. This kickstarts reading from the "input" handle. on_input_data
is setup to respond to the "data" event. This in turn emits a "output_data"
event which is watched internally, to then put() the data into the other
stream. When the input stream reached EOF, all of the clean up happens which
includes manually flushing the output handle to make sure everything is written
out. Then all of the events are ignored, the streams cleared, and the instance
( run in 0.787 second using v1.01-cache-2.11-cpan-4d50c553e7e )