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

Add sourceProcessWithStreams #258

Merged
merged 2 commits into from
Mar 13, 2016

Conversation

joehillen
Copy link
Contributor

Relates to #250

, (sourceStderr, closeStderr)
, cph) <- streamingProcess cp
(_, resStdout, resStderr) <-
runConcurrently $ (,,)
Copy link
Owner

Choose a reason for hiding this comment

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

Question: what behavior do we want if the provided Source or Sinks throw an exception? It may be appropriate to have an onException here that closes the streams and kills the child process. Thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That thought occurred to me when I saw your recent addition of withCheckedProcessCleanup.

I think it's reasonable to do that. I suppose if a user doesn't want the subprocess killed then they can catch exceptions in the Source/Sinks.

Should that also be added to sourceProcessWithConsumer? I'll assume so for now and add it to the PR.

sourceProcessWithConsumer and sourceProcessWithStreams now terminates
the process if their streams raises an exception
@joehillen
Copy link
Contributor Author

@snoyberg I've added the suggested exception handling.

snoyberg added a commit that referenced this pull request Mar 13, 2016
@snoyberg snoyberg merged commit 3227a38 into snoyberg:master Mar 13, 2016
@snoyberg
Copy link
Owner

Thanks!

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.

2 participants