Skip to content

Commit

Permalink
Revert "Fix issues with &await given conted Iterables"
Browse files Browse the repository at this point in the history
This reverts commit c51f179.

Per: https://irclog.perlgeek.de/moarvm/2017-12-20#i_15604339
+1 on not bending over backwards to DWIM with deconts for the user
  • Loading branch information
zoffixznet committed Dec 20, 2017
1 parent c51f179 commit 7df750a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions src/core.d/await.pm
Expand Up @@ -32,17 +32,15 @@ multi sub await(Iterable:D \i) {
($_ but X::Await::Died(Backtrace.new(5))).rethrow
}
}
# decont and flatten nested iterables
$*AWAITER.await-all: gather { i».take }
$*AWAITER.await-all(i)
}
multi sub await(*@awaitables) {
CATCH {
unless nqp::istype($_, X::Await::Died) {
($_ but X::Await::Died(Backtrace.new(5))).rethrow
}
}
# decont and flatten nested iterables
$*AWAITER.await-all: gather { @awaitables».take }
$*AWAITER.await-all(@awaitables)
}

my role X::React::Died {
Expand Down
4 changes: 2 additions & 2 deletions src/core/asyncops.pm
Expand Up @@ -50,8 +50,8 @@ multi sub await(Supply:D $s) {
my $*RAKUDO-AWAIT-BLOCKING := True;
$*AWAITER.await($s)
}
multi sub await(Iterable:D $i) { eager $i.eager.map({ await $_ }) }
multi sub await(*@awaitables) { eager @awaitables.eager.map({await $_}) }
multi sub await(Iterable:D $i) { $i.eager.map({ await $_ }) }
multi sub await(*@awaitables) { @awaitables.eager.map({await $_}) }

sub awaiterator(@promises) {
Seq.new(class :: does Iterator {
Expand Down

0 comments on commit 7df750a

Please sign in to comment.