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

use react in Proc::Async, closes #1468 #1496

Closed
wants to merge 2 commits into from
Closed

use react in Proc::Async, closes #1468 #1496

wants to merge 2 commits into from

Conversation

gfldex
Copy link
Contributor

@gfldex gfldex commented Sep 2, 2017

No description provided.

@AlexDaniel
Copy link
Member

Another attempt with a more elaborate (maybe too elaborate) example in #1489


react {
whenever $line-source.stdout.lines -> $l is copy {
put $l.chop;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This chops the data. There's no need to .chop when using .lines.

Also, is copy is probably unnecessary (at least in this example).

}
whenever signal(SIGINT) {
$line-source.close-stdin;
exit 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This exits without killing the process. In some cases the process can go down if it writes to stdin and the pipe is broken, but generally this is incorrect.

@gfldex gfldex closed this Sep 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants