Skip to content

Commit 6f5fb2f

Browse files
author
Nil Portugues Caldero
committed
Added documentation for Adapters
1 parent 83d9c51 commit 6f5fb2f

1 file changed

Lines changed: 68 additions & 3 deletions

File tree

README.md

Lines changed: 68 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@
55

66
- [Installation](#installation)
77
- [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)
816
- [Contribute](#contribute)
917
- [Support](#support)
1018
- [Authors](#authors)
@@ -35,9 +43,9 @@ This middleware requires a serializer and a storage that will depend on the Queu
3543
- **MongoDBQueue**: queue built with MongoDB library.
3644
- **RedisQueue**: queue using the Redis PHP extension.
3745
- **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.
4149

4250
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`.
4351

@@ -177,6 +185,63 @@ sudo supervisorctl update
177185
sudo supervisorctl start my_worker
178186
```
179187

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+
180245
## Contribute
181246

182247
Contributions to the package are always welcome!

0 commit comments

Comments
 (0)