Skip to content

Commit

Permalink
Merge pull request #2 from svenluijten/patch-1
Browse files Browse the repository at this point in the history
fix typos
  • Loading branch information
freekmurze authored Dec 14, 2017
2 parents 84b5a34 + e8197c1 commit 2e97ee7
Showing 1 changed file with 5 additions and 5 deletions.
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

0 comments on commit 2e97ee7

Please sign in to comment.