Skip to content

Commit 0b947dd

Browse files
committed
fix doc
1 parent c54c565 commit 0b947dd

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

docs/guide/consuming.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ An example of using this library.
1616

1717
## Consuming
1818

19-
You need to configure [Consumer.php](./../../src/Consumer.php) to read and processing messages from the queue.
19+
You need to configure [Consumer](./../../src/Consumer.php) to read and processing messages from the queue.
2020

2121
You can use a simple php cli, [Symfony/Console](https://symfony.com/doc/current/components/console.html)
2222
or any other component, it really doesn't matter.
@@ -26,6 +26,7 @@ The main idea is to run Consumer in a separate process in the background.
2626
Use your imagination to handling your messages.
2727

2828

29+
<br>
2930

3031
**Simple example for consuming with processors:**
3132
-------------------------------
@@ -45,15 +46,9 @@ $connection = \Doctrine\DBAL\DriverManager::getConnection([
4546
'path' => '/db/queue.db'
4647
]);
4748

48-
$tableCreator = new \Simple\Queue\QueueTableCreator($connection);
49-
5049
$producer = new \Simple\Queue\Producer($connection);
5150
$consumer = new \Simple\Queue\Consumer($connection, $producer);
5251

53-
// create table for queue messages
54-
$tableCreator->createDataBaseTable();
55-
56-
5752
echo 'Start consuming' . PHP_EOL;
5853

5954
// register process for processing all messages for "my_queue"
@@ -68,17 +63,19 @@ $consumer->bind('my_queue', static function(\Simple\Queue\Message $message, \Sim
6863
$consumer->consume();
6964
```
7065

66+
<br>
7167

7268

73-
**Simple example for consuming with jobs:**
69+
**Consuming algorithm:**
7470
-------------------------------
7571

72+
????
7673

7774

7875

7976

8077

81-
78+
<br>
8279

8380
**Custom example for consuming:**
8481
-------------------------------
@@ -124,10 +121,11 @@ while (true) {
124121
}
125122
```
126123

124+
<br>
127125

128126
## Message processing statuses
129127

130-
if you use jobs or processors when processing a message, you must return the appropriate status:
128+
If you use jobs or processors when processing a message, you must return the appropriate status:
131129

132130
* **ACK** - `\Simple\Queue\Consumer::STATUS_ACK` - message has been successfully processed and will be removed from the queue.
133131

@@ -137,7 +135,7 @@ if you use jobs or processors when processing a message, you must return the app
137135

138136
* **REQUEUE** - `\Simple\Queue\Consumer::STATUS_REQUEUE` - message has not been processed, it is necessary redelivered.
139137

140-
138+
<br>
141139

142140
## Run in background process
143141

0 commit comments

Comments
 (0)