On Sat Oct 08 19:08:38 2016, liu...@360.cn wrote: > Sporadic behavior as below is observed when the following code is > executed. Basically it is a situation of invoking emit for the same > supplier by multiple (in this case, two) on demand supplies. > > liukan@candor:~/Code$ cat golfed.pl6 > my $out = Supplier.new; > > sub watch( *@cmd ) > { > Supply.interval( 5 ).act: { > my $proc = Proc::Async.new: |@cmd; > my @rec; > $proc.stdout.lines.act: { > .chars ?? @rec.push: $_ !! $out.emit: @rec.splice; > }, done => { $out.emit: @rec } > $proc.start > } > } > > $out.Supply.act: { .say }; > > watch( < df -li > ); > watch( < df -lm > ); > > sleep 100; > > > liukan@candor:~/Code$ perl6 golfed.pl6 > Unhandled exception in code scheduled on thread 4 > Type check failed in binding to source; expected Any but got Mu (Mu) > in block at golfed.pl6 line 8 > > liukan@candor:~/Code$ perl6 golfed.pl6 > Unhandled exception in code scheduled on thread 4 > Type check failed in binding to source; expected Any but got Mu (Mu) > in block at golfed.pl6 line 8 > Hunted it down and got it fixed. Test in S17-procasync/stress.t.
Thanks, /jnthn