@@ -16,7 +16,7 @@ An example of using this library.
16
16
17
17
## Consuming
18
18
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.
20
20
21
21
You can use a simple php cli, [ Symfony/Console] ( https://symfony.com/doc/current/components/console.html )
22
22
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.
26
26
Use your imagination to handling your messages.
27
27
28
28
29
+ <br >
29
30
30
31
** Simple example for consuming with processors:**
31
32
-------------------------------
@@ -45,15 +46,9 @@ $connection = \Doctrine\DBAL\DriverManager::getConnection([
45
46
'path' => '/db/queue.db'
46
47
]);
47
48
48
- $tableCreator = new \Simple\Queue\QueueTableCreator($connection);
49
-
50
49
$producer = new \Simple\Queue\Producer($connection);
51
50
$consumer = new \Simple\Queue\Consumer($connection, $producer);
52
51
53
- // create table for queue messages
54
- $tableCreator->createDataBaseTable();
55
-
56
-
57
52
echo 'Start consuming' . PHP_EOL;
58
53
59
54
// register process for processing all messages for "my_queue"
@@ -68,17 +63,19 @@ $consumer->bind('my_queue', static function(\Simple\Queue\Message $message, \Sim
68
63
$consumer->consume();
69
64
```
70
65
66
+ <br >
71
67
72
68
73
- ** Simple example for consuming with jobs :**
69
+ ** Consuming algorithm :**
74
70
-------------------------------
75
71
72
+ ????
76
73
77
74
78
75
79
76
80
77
81
-
78
+ < br >
82
79
83
80
** Custom example for consuming:**
84
81
-------------------------------
@@ -124,10 +121,11 @@ while (true) {
124
121
}
125
122
```
126
123
124
+ <br >
127
125
128
126
## Message processing statuses
129
127
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:
131
129
132
130
* ** ACK** - ` \Simple\Queue\Consumer::STATUS_ACK ` - message has been successfully processed and will be removed from the queue.
133
131
@@ -137,7 +135,7 @@ if you use jobs or processors when processing a message, you must return the app
137
135
138
136
* ** REQUEUE** - ` \Simple\Queue\Consumer::STATUS_REQUEUE ` - message has not been processed, it is necessary redelivered.
139
137
140
-
138
+ < br >
141
139
142
140
## Run in background process
143
141
0 commit comments