From d796e46d5b42b236bce6e84bc5ec6a77ff76d781 Mon Sep 17 00:00:00 2001 From: Yada Clintjens Date: Tue, 7 Nov 2023 16:13:01 +0100 Subject: [PATCH] Fix typos in documentation and examples --- README.md | 8 ++++---- examples/02-transform-all.php | 2 +- examples/03-transform-any.php | 2 +- examples/users.ndjson | 2 +- src/Transformer.php | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index a03f652..7d93e01 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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. @@ -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 @@ -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. diff --git a/examples/02-transform-all.php b/examples/02-transform-all.php index 7eedce5..c62f21e 100644 --- a/examples/02-transform-all.php +++ b/examples/02-transform-all.php @@ -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; } diff --git a/examples/03-transform-any.php b/examples/03-transform-any.php index ea1284a..a1e5134 100644 --- a/examples/03-transform-any.php +++ b/examples/03-transform-any.php @@ -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; } diff --git a/examples/users.ndjson b/examples/users.ndjson index c1be7e6..b7127cd 100644 --- a/examples/users.ndjson +++ b/examples/users.ndjson @@ -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" } diff --git a/src/Transformer.php b/src/Transformer.php index c7975a8..9ed8aa2 100644 --- a/src/Transformer.php +++ b/src/Transformer.php @@ -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. * @@ -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 @@ -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.