Skip to content

Commit 88f9ed9

Browse files
authored
Merge pull request #868 from samnela/patch-1
Fixed the service id for Transport
2 parents 8e7a0f1 + baf3135 commit 88f9ed9

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

‎docs/bundle/message_producer.md‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ Enqueue is an MIT-licensed open source project with its ongoing development made
99

1010
# Message producer
1111

12-
You can choose how to send messages either using a transport directly or with the client.
12+
You can choose how to send messages either using a transport directly or with the client.
1313
Transport gives you the access to all transport specific features so you can tune things where the client provides you with easy to use abstraction.
14-
14+
1515
## Transport
16-
16+
1717
```php
1818
<?php
1919

2020
/** @var Symfony\Component\DependencyInjection\ContainerInterface $container */
2121

2222
/** @var Interop\Queue\Context $context */
23-
$context = $container->get('enqueue.transport.context');
23+
$context = $container->get('enqueue.transport.[transport_name].context');
2424

2525
$context->createProducer()->send(
2626
$context->createQueue('a_queue'),
@@ -30,15 +30,15 @@ $context->createProducer()->send(
3030

3131
## Client
3232

33-
The client is shipped with two types of producers. The first one sends messages immediately
33+
The client is shipped with two types of producers. The first one sends messages immediately
3434
where another one (it is called spool producer) collects them in memory and sends them `onTerminate` event (the response is already sent).
3535

36-
The producer has two types on send methods:
36+
The producer has two types on send methods:
3737

3838
* `sendEvent` - Message is sent to topic and many consumers can subscribe to it. It is "fire and forget" strategy. The event could be sent to "message bus" to other applications.
3939
* `sendCommand` - Message is to ONE exact consumer. It could be used as "fire and forget" or as RPC. The command message is always sent in scope of current application.
40-
41-
### Send event
40+
41+
### Send event
4242

4343
```php
4444
<?php
@@ -61,11 +61,11 @@ $spoolProducer = $container->get(SpoolProducer::class);
6161
// message is being sent on console.terminate or kernel.terminate event
6262
$spoolProducer->sendEvent('a_topic', 'Hello there!');
6363

64-
// you could send queued messages manually by calling flush method
64+
// you could send queued messages manually by calling flush method
6565
$spoolProducer->flush();
6666
```
6767

68-
### Send command
68+
### Send command
6969

7070
```php
7171
<?php
@@ -90,7 +90,7 @@ $spoolProducer = $container->get(SpoolProducer::class);
9090
// message is being sent on console.terminate or kernel.terminate event
9191
$spoolProducer->sendCommand('a_processor_name', 'Hello there!');
9292

93-
// you could send queued messages manually by calling flush method
93+
// you could send queued messages manually by calling flush method
9494
$spoolProducer->flush();
9595
```
9696

0 commit comments

Comments
 (0)