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

Allow to run multiple io.process.Process objects simultaneously #157

Merged
merged 1 commit into from Apr 2, 2016

Conversation

Projects
None yet
3 participants
@myaut
Copy link
Contributor

myaut commented Mar 17, 2016

Currently, Process incorrectly handles stdout/stderr channels which rely on
global state:

  • static methods used to handle read/close events are instantiated on
    module import. Thus, they are being mocked by addHandler() which sets
    .channel to them. Starting a new process causes resetting that field
    on the global method objects, thus all processes will receive output
    from the last started process. To mitigate this, static methods are
    replaced with closure-like lambdas.
  • Process incorrectly raises stopped() event to close stdout/stderr. This
    event, however, is used to signal Manager's death. Thus, when process is
    completed, all sockets/pipes in the entire program are closed. This is why
    stopped() event has to be replaced with process-specific terminated() event
    and we need explicitly send close() to all process pipes.
Sergey Klyaus Sergey Klyaus
Allow to run multiple io.process.Process objects simultaneously
Currently, Process incorrectly handles stdout/stderr channels which rely on
global state:
  - static methods used to handle read/close events are instantiated on
    module import. Thus, they are being mocked by addHandler() which sets
    .channel to them. Starting a new process causes resetting that field
    on the global method objects, thus all processes will receive output
    from the last started process. To mitigate this, static methods are
    replaced with closure-like lambdas.
  - Process incorrectly raises stopped() event to close stdout/stderr. This
    event, however, is used to signal Manager's death. Thus, when process is
    completed, all sockets/pipes in the entire program are closed. This is why
    stopped() event has to be replaced with process-specific terminated() event
    and we need explicitly send close() to all process pipes.
@spaceone

This comment has been minimized.

Copy link
Contributor

spaceone commented Mar 17, 2016

Can't the static methods be replaced by real methods?

@prologic

This comment has been minimized.

Copy link
Member

prologic commented Mar 18, 2016

@myaut I'l buy this :) Thanks! I guess on-one has really used the Process component to run simultaneous background processes before; weird :)

@prologic prologic merged commit 884b071 into circuits:master Apr 2, 2016

1 check failed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.