|
5 | 5 |
|
6 | 6 | - [Installation](#installation) |
7 | 7 | - [Usage](#usage) |
| 8 | + - [Adapter Configurations](#queue-adapter-configurations) |
| 9 | + - [PDOQueue](#pdoqueue) |
| 10 | + - [MongoDBQueue](#mongodbqueue) |
| 11 | + - [RedisQueue](#redisqueue) |
| 12 | + - [PredisQueue](#predisqueue) |
| 13 | + - [FileSystemQueue](#filesystemqueue) |
| 14 | + - [AmqpQueue](#amqpqueue) |
| 15 | + - [BeanstalkdQueue](#beanstalkdqueue) |
8 | 16 | - [Contribute](#contribute) |
9 | 17 | - [Support](#support) |
10 | 18 | - [Authors](#authors) |
@@ -35,9 +43,9 @@ This middleware requires a serializer and a storage that will depend on the Queu |
35 | 43 | - **MongoDBQueue**: queue built with MongoDB library. |
36 | 44 | - **RedisQueue**: queue using the Redis PHP extension. |
37 | 45 | - **PredisQueue**: queue using the Predis library. |
38 | | -- **FileSystem**: queue built with using the local file system. |
39 | | -- **Amqp**: use RabbitMQ or any queue implementing the Amqp protocol. |
40 | | -- **Beanstalkd**: use Beanstalk as queue. |
| 46 | +- **FileSystemQueue**: queue built with using the local file system. |
| 47 | +- **AmqpQueue**: use RabbitMQ or any queue implementing the Amqp protocol. |
| 48 | +- **BeanstalkdQueue**: use Beanstalk as queue. |
41 | 49 |
|
42 | 50 | To set it up, register the `ProducerEventBusMiddleware` to the Event Bus. Because we'll need to define a second EventBus (consumer), we'll call this the `ProducerEventBus`. |
43 | 51 |
|
@@ -177,6 +185,63 @@ sudo supervisorctl update |
177 | 185 | sudo supervisorctl start my_worker |
178 | 186 | ``` |
179 | 187 |
|
| 188 | +## Adapter Configurations |
| 189 | + |
| 190 | +#### PDOQueue |
| 191 | + |
| 192 | +For this to work, you'll be required to create a table in your database. |
| 193 | + |
| 194 | +For instance, sqlite dialect table creation would be: |
| 195 | + |
| 196 | +```sql |
| 197 | +CREATE TABLE testAdapterQueue ( |
| 198 | + id INTEGER PRIMARY KEY AUTOINCREMENT, |
| 199 | + event_data TEXT NOT NULL, |
| 200 | + event_status CHAR(50), |
| 201 | + created_at INTEGER NOT NULL |
| 202 | +); |
| 203 | +``` |
| 204 | + |
| 205 | +#### MongoDBQueue |
| 206 | + |
| 207 | +In order to use it, you require to install PHP 7's mongodb extension. |
| 208 | + |
| 209 | +``` |
| 210 | +sudo pecl install mongodb |
| 211 | +``` |
| 212 | + |
| 213 | +#### RedisQueue |
| 214 | + |
| 215 | +In order to use it, you require to install PHP 7's phpredis extension. |
| 216 | + |
| 217 | +``` |
| 218 | +# Build Redis PHP module |
| 219 | +git clone -b php7 https://github.com/phpredis/phpredis.git |
| 220 | +sudo mv phpredis/ /etc/ && \ |
| 221 | +cd /etc/phpredis \ |
| 222 | +phpize \ |
| 223 | +./configure \ |
| 224 | +make && make install \ |
| 225 | +touch /etc/php/7.0/mods-available/redis.ini \ |
| 226 | +echo 'extension=redis.so' > /etc/php/7.0/mods-available/redis.ini |
| 227 | +``` |
| 228 | + |
| 229 | +#### PredisQueue |
| 230 | + |
| 231 | +Nothing, but performs better if phpredis extension is found. |
| 232 | + |
| 233 | +#### FileSystemQueue |
| 234 | + |
| 235 | +Nothing to do. |
| 236 | + |
| 237 | +#### AmqpQueue |
| 238 | + |
| 239 | +Nothing to do other than having access to a amqp server. |
| 240 | + |
| 241 | +#### Beanstalkd |
| 242 | + |
| 243 | +Nothing to do other than having access to a beanstalkd server. |
| 244 | + |
180 | 245 | ## Contribute |
181 | 246 |
|
182 | 247 | Contributions to the package are always welcome! |
|
0 commit comments