Skip to content

Commit aaae22f

Browse files
authored
Merge pull request #364 from ddproxy/issue-363
Modify async_events.md grammar
2 parents 804c774 + 91da67b commit aaae22f

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

docs/bundle/async_events.md

+8-9
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,24 @@ The consumer, once it receives the message, restores the event and dispatches it
77

88
Async listeners benefits:
99

10-
* The response time lesser. It has to do less work.
11-
* Better fault tolerance. Bugs in async listener does not affect user. Messages will wait till you fix bugs.
10+
* Reduces response time. Work is deferred to consumer processes.
11+
* Better fault tolerance. Bugs in async listener do not affect user. Messages will wait till you fix bugs.
1212
* Better scaling. Add more consumers to meet the load.
1313

14-
_**Note**: The php serializer transformer (the default one) does not work on Symfony prior 3.0. The event contains eventDispatcher and therefor could not be serialized. You have to register a transformer for every async event. Read the [event transformer](#event-transformer)._
14+
_**Note**: Prior to Symfony 3.0, events contain `eventDispatcher` and the default php serializer transformer is unable to serialize the object. A transformer should be registered for every async event. Read the [event transformer](#event-transformer)._
1515

1616
## Configuration
1717

18-
I suppose you already [installed the bundle](quick_tour.md#install).
19-
Now, you have to enable `async_events`.
20-
If you do not enable it, events will be processed as before: synchronously.
18+
Symfony events are currently processed synchronously, enabling the async configuration for EnqueueBundle causes tagged listeners to defer action to a consumer asynchronously.
19+
If you already [installed the bundle](quick_tour.md#install), then enable `async_events`.
2120

2221
```yaml
2322
# app/config/config.yml
2423

2524
enqueue:
2625
async_events:
2726
enabled: true
28-
# if you'd like to send send messages onTerminate use spool_producer (it makes response time even lesser):
27+
# if you'd like to send send messages onTerminate use spool_producer (it further reduces response time):
2928
# spool_producer: true
3029
```
3130

@@ -77,7 +76,7 @@ services:
7776
## Event transformer
7877

7978
The bundle uses [php serializer](https://github.com/php-enqueue/enqueue-dev/blob/master/pkg/enqueue-bundle/Events/PhpSerializerEventTransformer.php) transformer by default to pass events through MQ.
80-
You could create a transformer for the given event type. The transformer must implement `Enqueue\AsyncEventDispatcher\EventTransformer` interface.
79+
You can write a transformer for each event type by implementing the `Enqueue\AsyncEventDispatcher\EventTransformer` interface.
8180
Consider the next example. It shows how to send an event that contains Doctrine entity as a subject
8281

8382
```php
@@ -165,4 +164,4 @@ services:
165164
The `eventName` attribute accepts a regexp. You can do next `eventName: '/foo\..*?/'`.
166165
It uses this transformer for all event with the name beginning with `foo.`
167166

168-
[back to index](../index.md)
167+
[back to index](../index.md)

0 commit comments

Comments
 (0)