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
Passing stdin to Proc::Async mostly does not work ($proc.print: …; $proc.close-stdin) #6398
Comments
From @AlexDanielCode: sub get-output() { $proc.print: �one\ntwo\nthree\nfour�; loop { get-output } Again, the result depends on your luck. Ideally it should not �die� ever, because there should always be one line in the output and therefore $success will be set to true. However, sometimes its stdout is empty and therefore it fails. It may fail after 20+ executions, and sometimes it fails almost immediately. Related ticket: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=131763 |
From @niner$proc.print is asynchronous while $proc.close-stdin is not. In some cases $proc simply does not get the input because we closed its stdin before printing anything. If .close-stdin is meant to by synchronous, this needs a doc patch. Otherwise we'd probably need to await any outstanding write promises before performing the actual nqp::closefh. |
The RT System itself - Status changed from 'new' to 'open' |
From @AlexDanielAlright, it seems that rakudo is not entirely incorrect here. See this discussion: https://irclog.perlgeek.de/perl6-dev/2017-07-18#i_14885863 TL;DR, one should use something like this: whenever $proc.print(“one\ntwo\nthree\nfour”) { $proc.close-stdin } So it seems that it's not a bug, but a trap maybe? I'll leave this for somebody else to close. On 2017-07-17 22:45:01, alex.jakimenko@gmail.com wrote:
|
From @AlexDanielClosing this myself in favor of this ticket: Raku/doc#1567 On 2017-07-17 23:51:21, alex.jakimenko@gmail.com wrote:
|
@AlexDaniel - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#131764 (status was 'resolved')
Searchable as RT131764$
The text was updated successfully, but these errors were encountered: