| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Async::Stream::FromArray; |
|
2
|
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
75809
|
use 5.010; |
|
|
3
|
|
|
|
|
10
|
|
|
4
|
3
|
|
|
3
|
|
19
|
use strict; |
|
|
3
|
|
|
|
|
7
|
|
|
|
3
|
|
|
|
|
75
|
|
|
5
|
3
|
|
|
3
|
|
18
|
use warnings; |
|
|
3
|
|
|
|
|
7
|
|
|
|
3
|
|
|
|
|
103
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
17
|
use base qw(Async::Stream); |
|
|
3
|
|
|
|
|
7
|
|
|
|
3
|
|
|
|
|
507
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
3
|
|
|
3
|
|
21
|
use Carp qw(croak); |
|
|
3
|
|
|
|
|
6
|
|
|
|
3
|
|
|
|
|
460
|
|
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 NAME |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
Use that class for creating streams from array. |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 VERSION |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
Version 0.11 |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=cut |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
our $VERSION = '0.12'; |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
use Async::Stream::FromArray; |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
my @domains = qw( |
|
29
|
|
|
|
|
|
|
ucoz.com |
|
30
|
|
|
|
|
|
|
ya.ru |
|
31
|
|
|
|
|
|
|
googl.com |
|
32
|
|
|
|
|
|
|
); |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
my $stream = Async::Stream::FromArray->new(@domains); |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 SUBROUTINES/METHODS |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head2 new(@array_of_items) |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
Constructor creates instance of class. |
|
42
|
|
|
|
|
|
|
Class method gets a list of items which are used for generating stream's items. |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
my @domains = qw( |
|
45
|
|
|
|
|
|
|
ucoz.com |
|
46
|
|
|
|
|
|
|
ya.ru |
|
47
|
|
|
|
|
|
|
googl.com |
|
48
|
|
|
|
|
|
|
); |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
my $stream = Async::Stream::FromArray->new(@urls) |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=cut |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub new { |
|
55
|
36
|
|
|
36
|
1
|
54664
|
my $class = shift; |
|
56
|
36
|
|
|
|
|
73
|
my $items = \@_; |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
return $class->SUPER::new( |
|
59
|
|
|
|
|
|
|
sub { |
|
60
|
145
|
100
|
|
145
|
|
234
|
$_[0]->( @{$items} ? (shift @{$items}) : () ); |
|
|
145
|
|
|
|
|
296
|
|
|
|
114
|
|
|
|
|
276
|
|
|
61
|
145
|
|
|
|
|
1938
|
return; |
|
62
|
|
|
|
|
|
|
} |
|
63
|
36
|
|
|
|
|
209
|
); |
|
64
|
|
|
|
|
|
|
} |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 AUTHOR |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Kirill Sysoev, C<< >> |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 BUGS AND LIMITATIONS |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
Please report any bugs or feature requests to |
|
74
|
|
|
|
|
|
|
L. |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 SUPPORT |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
perldoc Async::Stream::Item |
|
81
|
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Copyright 2017 Kirill Sysoev. |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
|
88
|
|
|
|
|
|
|
under the terms of the the Artistic License (2.0). You may obtain a |
|
89
|
|
|
|
|
|
|
copy of the full license at: |
|
90
|
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
L |
|
92
|
|
|
|
|
|
|
=cut |
|
93
|
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
1; # End of Async::Stream::FromArray |