Skip to content

Commit 409b028

Browse files
committed
ALLI-21969: clean up grammar and phrasing
1 parent c93d7c3 commit 409b028

28 files changed

Lines changed: 238 additions & 229 deletions

CHANGELOG.md

Lines changed: 40 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@ This project adheres to [Semantic Versioning](http://semver.org/).
77

88
### Fixed
99

10-
- `once` calls with no message handled will have an `{queueName} empty-receive`
10+
- `once` calls that handle no message will use an `{queueName} empty-receive`
1111
span name.
1212

1313
## 6.1.1
1414

1515
### Fixed
1616

17-
- Fixed the open telemetry `_register.php` file autoload
17+
- Fixed autoloading for the OpenTelemetry `_register.php` file.
1818

1919
## 6.1.0
2020

2121
### Added
2222

23-
- Added open telemetry instrumentation around `Consumer::once` and
24-
`Driver::enqueue`. These respect [messaging span](https://opentelemetry.io/docs/specs/semconv/messaging/messaging-spans/)
23+
- Added OpenTelemetry instrumentation around `Consumer::once` and
24+
`Driver::enqueue`. These follow [messaging span](https://opentelemetry.io/docs/specs/semconv/messaging/messaging-spans/)
2525
semantic conventions.
2626

2727
## 6.0.0
@@ -37,7 +37,7 @@ See [the upgrade guide](UPGRADE-6.0.md) for more information.
3737

3838
### Added
3939

40-
- Support PHP `^7.4 || ^8.0`
40+
- Added support for PHP `^7.4 || ^8.0`
4141

4242
### Changed
4343

@@ -49,26 +49,26 @@ See [the upgrade guide](UPGRADE-6.0.md) for more information.
4949

5050
- PHP 7.3+ is required.
5151
- Implementing `PMG\Queue\Message` is no longer required! Messages passed
52-
to the the producer and handled by the consumer can be any PHP object now.
53-
In the cases where a plain object is used, the message *name* is the full
54-
qualified class name. However, you may implement `Message` should you desire to
52+
to the producer and handled by the consumer can now be any PHP object.
53+
When a plain object is used, the message *name* is the fully qualified
54+
class name. However, you may implement `Message` if you want to
5555
keep the old behavior of having a specific message name that differs from the
5656
FQCN.
5757
- `PMG\Queue\Router::queueFor` now typehints against `object` instead of
5858
`Message`.
5959
- All `PMG\Queue\MessageLifecycle` methods now typehint against `object`.
6060
- `PMG\Queue\Envelope` and `DefaultEnvelope` now deal with `object` messages
61-
only and do not typehint again `Message`.
62-
- `PMG\Queue\Driver::enqueue` now typehints agains `object` instead of message.
63-
if a driver gets an `Envelope` instance it should use that instead of creating
61+
only and no longer typehint against `Message`.
62+
- `PMG\Queue\Driver::enqueue` now typehints against `object` instead of `Message`.
63+
If a driver gets an `Envelope` instance, it should use that instead of creating
6464
its own envelope. See [`UPGRADE-5.0.md`](/UPGRADE-5.0.md) for more details.
6565
- `PMG\Queue\MessageHandler::handle` now typehints against `object` instead of
6666
`Message`.
6767
- `PMG\Queue\Producer::send` now typehints against `object` instead of `Message`.
68-
- `MessageLifecycle::failed` no longer has an `$isRetrying` argument, instead
69-
`MessageLifecycyle::retrying` will be called instead.
68+
- `MessageLifecycle::failed` no longer has an `$isRetrying` argument. Instead,
69+
`MessageLifecycle::retrying` will be called.
7070
- `PMG\Queue\Router::queueFor` now has a `?string` return type.
71-
- Drivers should no longer call `Envelope::retry` instead, instead consumers
71+
- Drivers should no longer call `Envelope::retry`. Instead, consumers
7272
should call this method along with any delay required from the `RetrySpec`.
7373
See `UPGRADE-5.0.md` for more details.
7474

@@ -78,17 +78,17 @@ n/a
7878

7979
### Added
8080

81-
- A new `MessageLifecycle::retrying` method was added that gets called whenever
81+
- A new `MessageLifecycle::retrying` method was added and is called whenever
8282
a message fails and is retrying.
8383
- `PMG\Queue\Lifecycle\DelegatingLifecycle` has a new named constructor:
8484
`fromIterable`. This uses PHP 7.1's `iterable` pseudo type.
85-
- `RetrySpec::retryDelay` method added to allow a message to be delayed when
86-
retrying, if the driver supports it.
85+
- The `RetrySpec::retryDelay` method was added to allow a message to be delayed
86+
when retrying, if the driver supports it.
8787
- `Envelope::retry` now accepts an `int $delay` to support delayed retries. Not all
88-
drivers will be able to support delaying.
88+
drivers will support delays.
8989
- Similarly, `PMG\Queue\Driver` implementations must no longer call
90-
`Envelope::retry` as they were required to do previously. See `UPGRADE-5.0.md`
91-
for more details. Instead `PMG\Queue\Consumer` implementations should call
90+
`Envelope::retry`. See `UPGRADE-5.0.md` for more details. Instead,
91+
`PMG\Queue\Consumer` implementations should call
9292
`Envelope::retry`.
9393

9494
### Removed
@@ -145,13 +145,13 @@ n/a
145145
to `ensureSerializer`.
146146
- [BC Break, Internals] `Driver` now has more strict type declarations.
147147
- [BC Break, Internals] `Driver::release` was introduced.
148-
- [BC Break, Internals] `Consumer::once` and `Consumer::run` Now take an optional
149-
`MessageLifecycle` instance as their second argument. Only folks who wrote
148+
- [BC Break, Internals] `Consumer::once` and `Consumer::run` now take an optional
149+
`MessageLifecycle` instance as their second argument. Only people who wrote
150150
custom consumer implementations need to worry about this. See `DefaultConsumer`
151-
for an example how this may be handled. End users can keep using the consumer
152-
exactly as they were.
151+
for an example of how this may be handled. End users can keep using the
152+
consumer as before.
153153
- [BC Break, Internals] `MessageHandler::handle` now returns a promise object
154-
from the `guzzlehttp/promises` library. Only folks who wrote custom handler
154+
from the `guzzlehttp/promises` library. Only people who wrote custom handler
155155
implementations need to worry about this.
156156
- `RetrySpec::canRetry` now has a return type hint.
157157
- `Consumer::once` and `Consumer::run` have `string` typehints for their
@@ -182,10 +182,10 @@ n/a
182182

183183
### Added
184184

185-
- Child processes that exit abnormaly in `PcntlForkingHandler` now throw an
186-
`AbnormalExit` exception with some info about what went wrong. Practically
187-
this has no impact: the job is still failed and (possibly) retried, but the
188-
thrown exception will be logged and hopefully give users a better place to
185+
- Child processes that exit abnormally in `PcntlForkingHandler` now throw an
186+
`AbnormalExit` exception with some information about what went wrong.
187+
Practically, this has no impact: the job still fails and may be retried, but
188+
the thrown exception will be logged to give users a better place to
189189
start debugging.
190190

191191

@@ -194,8 +194,8 @@ n/a
194194
### Changed
195195

196196
- `PcntlForkingHandler` now throws a `CouldNotFork` exception that causes the
197-
consumer to exit unsuccessfully. Since a failure to fork is clearly on level
198-
with a driver error -- a system issue, not an application issue -- this is
197+
consumer to exit unsuccessfully. Since a failure to fork is on the same level
198+
as a driver error, a system issue rather than an application issue, this is
199199
more in line with what *should* happen. The consumer will exit and its process
200200
manager can restart it.
201201

@@ -205,7 +205,8 @@ n/a
205205
### Added
206206

207207
- There is a new `PMG\Queue\Handler\Pcntl` class that acts as a thin wrapper
208-
around the `pcntl_*` functions and `exit`. Mostly done for testing purposes.
208+
around the `pcntl_*` functions and `exit`. This exists mostly for testing
209+
purposes.
209210

210211
## 3.0.0
211212

@@ -214,16 +215,17 @@ n/a
214215
- [BC BREAK] PHP version requirement was bumped to 5.6
215216
- [BC BREAK] `DefaultConsumer::once` (and the `Consumer` interface) have been
216217
changed to make `once` safe to run in a loop. In other words, it never throws
217-
exceptions unless it's a must stop or an exception thrown from a driver. All
218-
other exceptions are logged, but not fatal. The idea here is to make consumers
218+
exceptions unless it is a must-stop exception or an exception thrown from a
219+
driver. All other exceptions are logged but are not fatal. The idea here is
220+
to make consumers
219221
safe to decorate without having to duplicate the error handling logic.
220222
- [BC BREAK] `PMG\Queue\Serializer\SigningSerializer` has been merged into
221223
`NativeSerializer` and removed. Pass your key as the first argument to
222224
`NativeSerializer`'s constructor.
223225
- [BC BREAK] `AbstractPersistanceDriver::getSerializer` was removed, use
224226
`AbstractPersistanceDriver::assureSerializer` instead.
225-
- [BC BREAK] `Consumer::stop` now takes an optional exit code. Only really
226-
relevant for implementors or the `Consumer` interface.
227+
- [BC BREAK] `Consumer::stop` now takes an optional exit code. This is mainly
228+
relevant for implementers of the `Consumer` interface.
227229
- [BC BREAK] `MessageExecutor`, `HandlerResolver`, and their implementations
228230
have been removed. See `UPGRADE-3.0.md` for some info on migration.
229231
- `Consumer` has docblocks that reflect its actual return values now.
@@ -253,7 +255,7 @@ BC Breaks:
253255
Bug Fixes:
254256

255257
- `SigningSerializer` now uses `hash_equals` instead of strict equality. PHP 5.5
256-
users will fallback on the Symfony 5.6 polyfill.
258+
users will fall back to the Symfony 5.6 polyfill.
257259

258260
New Features:
259261

@@ -287,7 +289,7 @@ Bug Fixes:
287289

288290
BC Breaks:
289291

290-
- everything, completely refactored
292+
- Everything was refactored.
291293

292294
New Features:
293295

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
# PMG\Queue
55

6-
`pmg/queue` is a production ready queue framework that powers many internal
6+
`pmg/queue` is a production-ready queue framework that powers many internal
77
projects at [PMG](https://www.pmg.com/).
88

9-
It's simple and extensible a number of features we've found to be the most
10-
useful including automatic retries and multi-queue support.
9+
It is simple and extensible, with features we have found most useful,
10+
including automatic retries and multi-queue support.
1111

1212
## [Documentation](http://pmg-queue.readthedocs.io/en/latest/)

UPGRADE-3.0.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ The biggest change is the extraction of the `PheanstalkDriver` into its own
1010
library. Rather than `composer require pmg/queue`, you'll want to require the
1111
pheanstalk driver instead: `composer require pmg/queue-pheanstalk`.
1212

13-
## Introduction of `MessageHandler` and removal of Exectors & Resolvers
13+
## Introduction of `MessageHandler` and Removal of Executors & Resolvers
1414

15-
Previously you gave the consumer an instance of a `MessageExector` that wrapped
15+
Previously, you gave the consumer an instance of a `MessageExecutor` that wrapped
1616
up a `HandlerResolver`. The point of this was to map callables to message names.
1717

18-
In 3.0, we replace those two things with a single `MessageHandler` interface.
19-
There are two built in: a `CallableHandler` and `PcntlForkingHandler`.
18+
In 3.0, those two pieces are replaced by a single `MessageHandler` interface.
19+
There are two built-in options: a `CallableHandler` and `PcntlForkingHandler`.
2020

21-
This was done to better reflect how PMG is using the Queue (and how we think it
22-
should be used).
21+
This change better reflects how PMG uses Queue and how we think it should be
22+
used.
2323

2424
### 2.X
2525

@@ -65,7 +65,7 @@ No problem, it was moved into its own library.
6565
composer require pmg/queue-mapping-handler
6666
```
6767

68-
And use it like so:
68+
Use it like this:
6969

7070
```php
7171
use PMG\Queue as Q;

UPGRADE-4.0.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
## PHP Version Requirement Bumped to ~7.0
44

5-
Support for PHP 5.6+ dropped. Stick with 3.X need PHP 5 support is still
5+
Support for PHP 5.6+ was dropped. Stick with 3.X if PHP 5 support is still
66
necessary.
77

88
## `NativeSerializer` Now Requires a `Signer` Instance
99

10-
Previously one could pass a key to `NativeSerializer` directly. Now a `Signer`
10+
Previously, you could pass a key to `NativeSerializer` directly. Now a `Signer`
1111
instance is required. A named constructor is provided if the 3.X behavior is
1212
still desired.
1313

@@ -33,9 +33,9 @@ for more info.
3333

3434
## For Handler Authors
3535

36-
Implementation of `MessageHandler` now requires a `GuzzleHttp\Promise\PromiseInterface`
37-
be returned from the `handle` method. This lets consumers do much more graceful
38-
stopping. If your handler does not *really* need a promise, use `FulfilledPromise`:
36+
Implementing `MessageHandler` now requires returning a `GuzzleHttp\Promise\PromiseInterface`
37+
from the `handle` method. This lets consumers stop much more gracefully.
38+
If your handler does not *really* need a promise, use `FulfilledPromise`:
3939

4040
```php
4141
use GuzzleHttp\Promise\FulfilledPromise;
@@ -62,7 +62,7 @@ for the updated method signatures.
6262

6363
### `Driver::release` was Added
6464

65-
This is a method that should skip the retry system for the given
65+
This method should skip the retry system for the given
6666
envelope/message and put it back into a ready state immediately.
6767

6868
### `assureSerializer` was renamed in `AbstractPersistanceDriver`

UPGRADE-5.0.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,23 @@
22

33
## PHP Version Requirement Bumped to ~7.3
44

5-
Stick with version 4.X should PHP 7.0, 7.1, or 7.2 support be required.
5+
Stick with version 4.X if PHP 7.0, 7.1, or 7.2 support is required.
66

77
## Messages No Longer Need to Implement `PMG\Queue\Message`
88

9-
Producers and consumers can now deal with plain objects. By default the *message name*
10-
for plain object messgaes is the fully qualified class name (FQCN).
9+
Producers and consumers can now deal with plain objects. By default, the
10+
*message name* for plain object messages is the fully qualified class name
11+
(FQCN).
1112

1213
You may, however, implement `PMG\Queue\Message` (and its `getName` method) should
1314
you want to continue using message names other than FQCNs.
1415

15-
The `PMG\Queue\MessageTrait` which provided the FQCN as a name behavior was also
16+
The `PMG\Queue\MessageTrait`, which provided FQCN-based naming, was also
1617
removed.
1718

1819
### Router Updates for Message Names
1920

20-
The producers routing configuration may need to be updated should you choose to
21+
The producer's routing configuration may need to be updated should you choose to
2122
use FQCNs as the message names.
2223

2324
#### Version 4.X
@@ -43,8 +44,8 @@ $router = new MappingRouter([
4344

4445
## `MessageLifecycle` Has a New `retrying` Method
4546

46-
Rather than have an `$isRetrying` flag in the `failed` method. If the message is
47-
being retried the `retrying` method will be invoked, otherwise `failed` will.
47+
Instead of using an `$isRetrying` flag in the `failed` method, the consumer now
48+
calls `retrying` when a message is being retried and `failed` otherwise.
4849

4950
This should be a pretty easy upgrade:
5051

@@ -127,9 +128,9 @@ final class CustomRouter implements Router
127128
}
128129
```
129130

130-
## `MessageHandler::handle` Now Accept an Object
131+
## `MessageHandler::handle` Now Accepts an Object
131132

132-
Any custom implementation of `MessageHandler` will need to be udpated.
133+
Any custom implementation of `MessageHandler` will need to be updated.
133134

134135
```diff
135136
use GuzzleHttp\Promise\PromiseInterface;
@@ -156,8 +157,8 @@ All changes here are only relevant to authors of `PMG\Queue\Driver`,
156157

157158
And `send` now has a `void` return type as well.
158159

159-
This is part of a broader change (see above) around pmg/queue dealing with
160-
plain `object` without the requirement of a `Message` implementation.
160+
This is part of a broader change (see above) around `pmg/queue` handling plain
161+
objects without requiring a `Message` implementation.
161162

162163
```diff
163164
-use PMG\Queue\Message;
@@ -177,7 +178,7 @@ plain `object` without the requirement of a `Message` implementation.
177178
### `Driver::enqueue` Now Takes an `object` Instead of a `Message`
178179

179180
Drivers should handle receiving an `Envelope` instance in this method as well.
180-
Should that happen the driver *must* use that envelope instead of creating its
181+
If that happens, the driver *must* use that envelope instead of creating its
181182
own.
182183

183184

@@ -209,7 +210,7 @@ own.
209210
In 4.X (and lower) drivers were required to call `$envelope->retry()` on any
210211
envelope passed in `Driver::retry`.
211212

212-
That should now happen in implements of `PMG\Queue\Consumer` instead.
213+
That should now happen in implementations of `PMG\Queue\Consumer` instead.
213214

214215
#### Version 4.X Driver
215216

UPGRADE-6.0.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## PHP Version Requirement Bumped to ^8.0
44

5-
Stick with version 5.X should PHP ^7.3 support be required.
5+
Stick with version 5.X if PHP ^7.3 support is required.
66

77
## Lifecycle Changes
88

@@ -17,5 +17,5 @@ Stick with version 5.X should PHP ^7.3 support be required.
1717

1818
## MessageTrait
1919

20-
- `PMG\Queue\MessageTrait` was removed, the default behavior has been to use the
21-
FQCN since 5.X, so this added no additional functionalty.
20+
- `PMG\Queue\MessageTrait` was removed. The default behavior has been to use the
21+
FQCN since 5.X, so this added no additional functionality.

0 commit comments

Comments
 (0)