Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't easily distinguish a child that exits with 0 from nothing having exited at all [rt.cpan.org #114447] #93

Open
toddr opened this issue May 12, 2017 · 1 comment
Labels
Feature Feature Request

Comments

@toddr
Copy link
Member

toddr commented May 12, 2017

Migrated from rt.cpan.org#114447 (status was 'open')

Requestors:

From [email protected] on 2016-05-17 20:36:29:

The ->result and ->full_result methods return nothing if all the children have exited 0. They also return nothing if none of the children have exited.

The only way to see if the children have actually exited is to look at ->results or ->full_results.

This is kind of annoying. It'd be nice if there was a simply way to get the status, zero or not.

From [email protected] on 2016-11-17 05:55:10:

Strongly agree. Newer IPC::Run doesn't let you just call 'results' either, since it calls _assert_finished which will die() if still busy.

It'd be good to expose a:

->finished

or similar, with similar semantics to ->result (no index = first child, otherwise n'th child).

The docs don't mention how to tell whether a child or all children has exited at all. Even a minimal'finished' method like

sub finished {
    my IPC::Run $self = $_[0];
    return $self->{STATE} >= _finished;
}

would be helpful.

It seems like the only "official" way at the moment is to poll "pumpable" until it returns false, but this isn't really documented either. Additional text for the perldoc for 'pumpable' like:

To wait for a child process to exit during an event loop, test $h->pumpable until it returns false.
@toddr toddr added the Feature Feature Request label Mar 26, 2018
@toddr
Copy link
Member Author

toddr commented Mar 26, 2018

@autarch This seems to be a feature request. I'm not actively developing IPC::Run right now. Patches are welcome though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Feature Request
Projects
None yet
Development

No branches or pull requests

1 participant