Skip to content

Conversation

@clue
Copy link
Member

@clue clue commented Jan 13, 2018

This PR introduces a simple check to see if the program is already known to be closed when the last process pipe is closed. This simple change improves "exit" detection significantly for most programs and does not cause a noticeable penalty for more advanced use cases.

Most programs do not explicitly close their STDIO handles and these will be closed implicitly when the program exits. Accordingly, we will now detect the "exit" event immediately without having to start a timer.

More advanced programs may close their STDIO handles explicitly while the program is still running. We continue to use a perodic timer to check the program state in this case.

Supersedes / closes #15, thanks @nicolas-grekas!

Copy link
Member

@WyriHaximus WyriHaximus left a comment

Choose a reason for hiding this comment

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

🚢 🇮🇹 !

@jsor jsor merged commit d2b7244 into reactphp:master Jan 18, 2018
@clue clue deleted the fast-exit branch January 18, 2018 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants