On Thu, 21 May 2015 12:50:18 -0700, tony.od...@live.com wrote:
> Encountered the following problem implementing Event::Emitter between
> processes.  This code will run forever as .read(1) forever reads
> nothing from $*IN
> 
> 
> #!/usr/bin/env perl6
> 
> 
> 
> 
> my $p = Proc::Async.new('perl6', '-e', '
>    await start {
> 
> my $d = $*IN.read(1);
> 
> while $d.elems == 0 {
> 
> $d = $*IN.read(1);
> 
> }
> 
> $d.say;
> 
> };', :w);
> 
> 
> 
> my $r = $p.start;
> 
> $p.write("0".encode);
> 
> await $r;
> 
> 
> ----------------------------------------------------------
> 
> ACTUAL:
> Sub process 'reads' an empty Buf forever
> 
> EXPECTED:
> Sub process eventually 'reads' a Buf containing 1 byte
> 

This was one of the many cases of I/O handles not working across different 
threads, which was fixed earlier on this year. Output is now:

Buf[uint8]:0x<30>

Various tests were added covering this, as it showed up in various other 
tickets, so will mark this issue resolved.

Reply via email to