Skip Menu |
Report information
Id: 127587
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: john.haltiwanger [at] gmail.com
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: MacOS X
Patch Status: (no value)
VM: (no value)



Subject: [OS X] External process return values affecting react blocks
Date: Sun, 21 Feb 2016 12:52:46 +0000
To: "rakudobug [...] perl.org" <rakudobug [...] perl.org>
From: John Haltiwanger <john.haltiwanger [...] gmail.com>
Download (untitled) / with headers
text/plain 818b
I discovered this behavior while using IO.watch, but it is also demonstrable with a simple interval supply.

It occurs with both Proc::Async and qq:x. I've included both for easy testing. The 'echo' never actually runs. I only get 'interval 1' and then the script returns.

# Proc::Async

sub MAIN {
    react {
        whenever Supply.interval(1) {
            start {
                my $phrase = "interval {++$}" .say;
                my $cmd = Proc::Async.new: 'echo', "echo: $phrase";
                $cmd.stdout.tap: *.say;
                await $cmd.start;
            }
        }
    }
}

## qq:x

sub MAIN {
    react {
        whenever Supply.interval(1) {
            start {
                my $phrase = "interval {++$}" .say;
                qq:x[ echo  "echo: $phrase" ];
            }
        }
    }
}
Subject: Re: [perl #127587] [OS X] External process return values affecting react blocks
Date: Tue, 23 Feb 2016 01:10:36 +0000
To: perl6-compiler [...] perl.org, bugs-bitbucket [...] rt.perl.org
From: Lloyd Fournier <lloyd.fourn [...] gmail.com>
Download (untitled) / with headers
text/plain 1.3k

On Tue, Feb 23, 2016 at 3:41 AM ab5tract <perl6-bugs-followup@perl.org> wrote:
Show quoted text
# New Ticket Created by  ab5tract
# Please include the string:  [perl #127587]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/Ticket/Display.html?id=127587 >


I discovered this behavior while using IO.watch, but it is also
demonstrable with a simple interval supply.

It occurs with both Proc::Async and qq:x. I've included both for easy
testing. The 'echo' never actually runs. I only get 'interval 1' and then
the script returns.

# Proc::Async

sub MAIN {
    react {
        whenever Supply.interval(1) {
            start {
                my $phrase = "interval {++$}" .say;
                my $cmd = Proc::Async.new: 'echo', "echo: $phrase";
                $cmd.stdout.tap: *.say;
                await $cmd.start;
            }
        }
    }
}

## qq:x

sub MAIN {
    react {
        whenever Supply.interval(1) {
            start {
                my $phrase = "interval {++$}" .say;
                qq:x[ echo  "echo: $phrase" ];
            }
        }
    }
}


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org