-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
#31 restart process #32
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure whether I like restarting directly in the same instance, but the patch looks really simple. Maybe restart should return a new instance?
lib/Process.php
Outdated
return $this->processRunner->join($this->handle); | ||
return call(function () { | ||
$result = yield $this->processRunner->join($this->handle); | ||
$this->handle = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll need to reset the PID as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now restart return new instance
Main purpose of restart is to use it in amphp/parallel#64. |
I'm not sure if this method makes sense or is necessary. No functionality is being added. Additionally, the method hides what is really happening behind a boolean argument – |
Closing for the reasons outlined above. If we want to create a new, identical |
Related to #31