3 package Data::Stream::Bulk::Cat;
6 use namespace::clean -except => 'meta';
8 with qw(Data::Stream::Bulk) => { excludes => 'list_cat' };
11 isa => "ArrayRef[Data::Stream::Bulk]",
18 @{ $self->streams } == 0;
24 my $s = $self->streams;
30 until ( $next = @$s && $s->[0]->next ) {
39 my ( $self, @rest ) = @_;
40 my ( $head, @tail ) = ( @{ $self->streams }, @rest );
41 return () unless $head;
42 return $head->list_cat(@tail);
45 __PACKAGE__->meta->make_immutable;
55 Data::Stream::Bulk::Cat - Concatenated streams
59 use Data::Stream::Bulk::Cat;
61 Data::Stream::Bulk::Cat->new(
62 streams => [ $s1, $s2, $s3 ],
67 This stream is a concatenation of several other streams.
75 Returns true if the list of streams is empty.
79 Returns the next block from the next ready stream.
83 Breaks down the internal list of streams, and delegates C<list_cat> to the
86 Has the effect of inlining the nested streams into the total concatenation,
87 allowing L<Data::Stream::Bulk::Array/list_cat> to work better.