Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Give HyperToIterator its own push-all
Should help a bit in the my @A = foo.hyper.bar case.
- Loading branch information
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,6 +92,24 @@ my class Rakudo::Internals::HyperToIterator does Rakudo::Internals::HyperJoiner | |
} | ||
0 | ||
} | ||
|
||
method push-all($target) { | ||
loop { | ||
$target.append($!current-items); | ||
$!current-items := $!batches.receive.items; | ||
self.batch-used(); | ||
|
||
CATCH { | ||
when X::Channel::ReceiveOnClosed { | ||
return IterationEnd; | ||
} | ||
default { | ||
($_ but X::HyperRace::Died(Backtrace.new(5))).rethrow | ||
unless nqp::istype($_, X::HyperRace::Died); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
lizmat
Author
Contributor
|
||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
# vim: ft=perl6 expandtab sw=4 |
This doesn't rethrow if
$_
is alreadyX::HyperRace::Died
; is that intentional?