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

fix typos #2

Merged
merged 1 commit into from
Dec 14, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ await($pool);

When using this package, you're probably wondering what's happening underneath the surface.

PHP has an extension called [PCNTL](http://php.net/manual/en/book.pcntl.php) which can spawn forks of it's current process.
PHP has an extension called [PCNTL](http://php.net/manual/en/book.pcntl.php) which can spawn forks of its current process.
PCNTL directly uses your system's `fork` call to create a copy of the process, as a child process.

By creating child processes on the fly, we're able to execute PHP scripts in parallel.
Expand All @@ -143,9 +143,9 @@ Sometimes you also have points in your code which have to wait until the result
This is why we have to wait at a certain point in time: for all processes on a pool to finish,
so we can be sure it's safe to continue without accidentally killing the child processes which aren't done yet.

"Waiting" for all processes is done in a while loop, which will check the status of every process once in a while.
When a process is finished, it's success event is triggered, which you cna hook into with the `->then()` function.
Likewise, when a process fails or times out, the loop will update that process its status and move on.
"Waiting" for all processes is done in a `while` loop, which will check the status of every process once in a while.
When a process is finished, its success event is triggered, which you can hook into with the `->then()` function.
Likewise, when a process fails or times out, the loop will update that process' status and move on.

When all processes are finished, the while loop will see that there's nothing more to wait for, and stop.
This is the moment your parent process can continue to execute.
Expand All @@ -155,7 +155,7 @@ You might for example want to use the result generated by your child processes,

Our package uses UNIX sockets for this communication.
Once a process is executed, we'll serialize its output and send it via a socket to the parent process,
who cna handle it further in the while loop we spoke about earlier.
who can handle it further in the while loop we spoke about earlier.

When a process throws an exception or fails, we can also catch that output and send it via the socket to the parent.
That's how you can also listen for unhandled exceptions thrown in a child process, and handle them yourself.
Expand Down