You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code below shows how to use simple client with AMQP transport. There are other [supported brokers](supported_brokers.md).
20
+
19
21
```php
20
22
<?php
21
23
use Enqueue\SimpleClient\SimpleClient;
@@ -27,25 +29,56 @@ $client = new SimpleClient('amqp:');
27
29
28
30
## Produce message
29
31
32
+
There two types of message a client can produce: events and commands.
33
+
Events are used to notify others about something, in other words it is an implementation of [publish-subscribe pattern](https://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern), sometimes called "fire-and-forget" too.
34
+
With events there is no way to get a reply as a producer is not aware of any subscribed consumers.
35
+
Commands are used to request a job to be done. It is an implementation of one-to-one messaging pattern.
36
+
A producer can request a reply from the consumer though it is up to the consumer whether send it or not.
37
+
38
+
Commands work inside the app [scope](message_examples.md#scope) where events work inside the app scope as well as on [message bus](message_bus.md) scope.
0 commit comments