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 in documentation and examples #28

Merged
merged 1 commit into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ by individually sending a (RESTful) HTTP API request to some third party API
for each record. Estimating each call to take around `0.3s` means that having
`10000` users processed sequentially, you would have to wait around 50 minutes
for all jobs to complete. This works perfectly fine for a small number of
operations, but keeping thousands of jobs in memory at once may easly take up
operations, but keeping thousands of jobs in memory at once may easily take up
all resources on your side.
Instead, you can use this library to stream your arbitrarily large input list
as individual records to a non-blocking (async) transformation handler. It uses
Expand Down Expand Up @@ -141,7 +141,7 @@ also takes care of mangaging streaming throughput and back-pressure.
The transformation handler can be any non-blocking (async) callable that uses
[promises](#promises) to signal its eventual results. This callable receives
a single data argument as passed to the writable side and must return a
promise. A succesful fulfillment value will be forwarded to the readable end
promise. A successful fulfillment value will be forwarded to the readable end
of the stream, while an unsuccessful rejection value will emit an `error`
event and then `close()` the stream.

Expand Down Expand Up @@ -306,7 +306,7 @@ passed through its transformation handler which is responsible for processing
and transforming this data (see above for more details).

The `Transformer` takes care of passing data you pass on its writable side to
the transformation handler argument and forwarding resuling data to it
the transformation handler argument and forwarding resulting data to it
readable end.
Each operation may take some time to complete, but due to its async nature you
can actually start any number of (queued) operations. Once the concurrency limit
Expand Down Expand Up @@ -341,7 +341,7 @@ $transformer->write('http://example.com/');
```

This handler receives a single data argument as passed to the writable side
and must return a promise. A succesful fulfillment value will be forwarded to
and must return a promise. A successful fulfillment value will be forwarded to
the readable end of the stream, while an unsuccessful rejection value will
emit an `error` event, try to `cancel()` all pending operations and then
`close()` the stream.
Expand Down
2 changes: 1 addition & 1 deletion examples/02-transform-all.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function ($count) {
echo 'Successfully processed all ' . $count . ' user records' . PHP_EOL;
},
function (Exception $e) {
echo 'An error occured: ' . $e->getMessage() . PHP_EOL;
echo 'An error occurred: ' . $e->getMessage() . PHP_EOL;
if ($e->getPrevious()) {
echo 'Previous: ' . $e->getPrevious()->getMessage() . PHP_EOL;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/03-transform-any.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function ($user) {
echo 'Successfully processed user record:' . print_r($user, true) . PHP_EOL;
},
function (Exception $e) {
echo 'An error occured: ' . $e->getMessage() . PHP_EOL;
echo 'An error occurred: ' . $e->getMessage() . PHP_EOL;
if ($e->getPrevious()) {
echo 'Previous: ' . $e->getPrevious()->getMessage() . PHP_EOL;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/users.ndjson
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
{ "name": "sixth", "birthday": "1962-01-01", "ip": "6.1.1.1" }
{ "name": "seventh", "birthday": "1951-01-01", "ip": "7.1.1.1" }
{ "name": "eighth", "birthday": "1940-01-01", "ip": "8.1.1.1" }
{ "name": "nineth", "birthday": "1939-01-01", "ip": "9.1.1.1" }
{ "name": "ninth", "birthday": "1939-01-01", "ip": "9.1.1.1" }
{ "name": "tenth", "birthday": "1928-01-01" }
6 changes: 3 additions & 3 deletions src/Transformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* The transformation handler can be any non-blocking (async) callable that uses
* [promises](#promises) to signal its eventual results. This callable receives
* a single data argument as passed to the writable side and must return a
* promise. A succesful fulfillment value will be forwarded to the readable end
* promise. A successful fulfillment value will be forwarded to the readable end
* of the stream, while an unsuccessful rejection value will emit an `error`
* event and then `close()` the stream.
*
Expand Down Expand Up @@ -151,7 +151,7 @@
* and transforming this data (see above for more details).
*
* The `Transformer` takes care of passing data you pass on its writable side to
* the transformation handler argument and forwarding resuling data to it
* the transformation handler argument and forwarding resulting data to it
* readable end.
* Each operation may take some time to complete, but due to its async nature you
* can actually start any number of (queued) operations. Once the concurrency limit
Expand Down Expand Up @@ -186,7 +186,7 @@
* ```
*
* The handler receives a single data argument as passed to the writable side
* and must return a promise. A succesful fulfillment value will be forwarded to
* and must return a promise. A successful fulfillment value will be forwarded to
* the readable end of the stream, while an unsuccessful rejection value will
* emit an `error` event, try to `cancel()` all pending operations and then
* `close()` the stream.
Expand Down