Item for Async::Stream
Version 0.11
Creating and managing item for Async::Stream
use Async::Stream::Item; my $stream_item = Async::Stream::Item->new($value, $next_item_cb);
Constructor creates instance of class. Class method gets 2 arguments item's value and generator subroutine references to generate next item.
my $i = 0; my $stream_item = Async::Stream::Item->new($i++, sub { my $return_cb = shift; if($i < 100){ $return_cb->($i++) } else { $return_cb->() } });
Method returns item's value.
my $value = $stream_item->val;
Method returns next item in stream. Method gets callback to return next item.
$stream_item->next(sub { my $next_stream_item = shift; });
Kirill Sysoev, <k.sysoev at me.com>
<k.sysoev at me.com>
Please report any bugs or feature requests to https://github.com/pestkam/p5-Async-Stream/issues.
You can find documentation for this module with the perldoc command.
perldoc Async::Stream::Item
Copyright 2017 Kirill Sysoev.
This program is free software; you can redistribute it and/or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at:
http://www.perlfoundation.org/artistic_license_2_0
To install Async::Stream, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Async::Stream
CPAN shell
perl -MCPAN -e shell install Async::Stream
For more information on module installation, please visit the detailed CPAN module installation guide.