|
1 |
| -#mongo-queue-php |
2 |
| -[](https://travis-ci.org/dominionenterprises/mongo-queue-php) |
3 |
| -[](https://scrutinizer-ci.com/g/dominionenterprises/mongo-queue-php/) |
4 |
| -[](https://coveralls.io/r/dominionenterprises/mongo-queue-php) |
| 1 | +# mongo-queue-php |
| 2 | +[](https://travis-ci.org/traderinteractive/mongo-queue-php) |
| 3 | +[](https://scrutinizer-ci.com/g/traderinteractive/mongo-queue-php/?branch=master) |
| 4 | +[](https://coveralls.io/github/traderinteractive/mongo-queue-php) |
5 | 5 |
|
6 |
| -[](https://packagist.org/packages/dominionenterprises/mongo-queue-php) |
7 |
| -[](https://packagist.org/packages/dominionenterprises/mongo-queue-php) |
8 |
| -[](https://packagist.org/packages/dominionenterprises/mongo-queue-php) |
| 6 | +[](https://packagist.org/packages/traderinteractive/mongo-queue-php) |
| 7 | +[](https://packagist.org/packages/traderinteractive/mongo-queue-php) |
| 8 | +[](https://packagist.org/packages/traderinteractive/mongo-queue-php) |
| 9 | + |
| 10 | +[](https://packagist.org/packages/traderinteractive/mongo-queue-php) |
| 11 | +[](https://packagist.org/packages/traderinteractive/mongo-queue-php) |
| 12 | +[](https://packagist.org/packages/traderinteractive/mongo-queue-php) |
9 | 13 |
|
10 | 14 | PHP message queue using MongoDB as a backend.
|
11 |
| -Adheres to the 1.0.0 [specification](https://github.com/dominionenterprises/mongo-queue-specification). |
12 | 15 |
|
13 |
| -##Features |
| 16 | +## Features |
14 | 17 |
|
15 | 18 | * Message selection and/or count via MongoDB query
|
16 | 19 | * Distributes across machines via MongoDB
|
17 |
| - * Multi language support through the [specification](https://github.com/dominionenterprises/mongo-queue-specification) |
18 | 20 | * Message priority
|
19 | 21 | * Delayed messages
|
20 | 22 | * Running message timeout and redeliver
|
21 | 23 | * Atomic acknowledge and send together
|
22 | 24 | * Easy index creation based only on payload
|
23 | 25 |
|
24 |
| -##Simplest use |
| 26 | +## Simplest use |
25 | 27 |
|
26 | 28 | ```php
|
27 |
| -use DominionEnterprises\Mongo\Queue; |
| 29 | +use TraderInteractive\Mongo\Queue; |
28 | 30 |
|
29 | 31 | $queue = new Queue('mongodb://localhost', 'queues', 'queue');
|
30 |
| -$queue->send(array()); |
31 |
| -$message = $queue->get(array(), 60); |
32 |
| -$queue->ack($message); |
| 32 | +$queue->send(new Message()); |
| 33 | +$messages = $queue->get([], ['runningResetDuration' => 60]); |
| 34 | +foreach ($messages as $message) { |
| 35 | + // Do something with message |
| 36 | + |
| 37 | + $queue->ack($message); |
| 38 | +} |
33 | 39 | ```
|
34 | 40 |
|
35 |
| -##Composer |
| 41 | +## Composer |
36 | 42 |
|
37 |
| -To add the library as a local, per-project dependency use [Composer](http://getcomposer.org)! Simply add a dependency on |
38 |
| -`dominionenterprises/mongo-queue-php` to your project's `composer.json` file such as: |
| 43 | +To add the library as a local, per-project dependency use [Composer](http://getcomposer.org)! Simply add a |
| 44 | +dependency on `traderinteractive/mongo-queue` to your project's `composer.json` file such as: |
39 | 45 |
|
40 |
| -```json |
41 |
| -{ |
42 |
| - "require": { |
43 |
| - "dominionenterprises/mongo-queue-php": "1.*" |
44 |
| - } |
45 |
| -} |
| 46 | +```sh |
| 47 | +composer require traderinteractive/mongo-queue |
46 | 48 | ```
|
47 | 49 |
|
48 |
| -##Documentation |
| 50 | +## Documentation |
49 | 51 |
|
50 |
| -Found in the [source](src/Queue.php) itself, take a look! |
| 52 | +Found in the [source](src/) itself, take a look! |
51 | 53 |
|
52 |
| -##Contact |
| 54 | +## Contact |
53 | 55 |
|
54 | 56 | Developers may be contacted at:
|
55 | 57 |
|
56 |
| - * [Pull Requests](https://github.com/dominionenterprises/mongo-queue-php/pulls) |
57 |
| - * [Issues](https://github.com/dominionenterprises/mongo-queue-php/issues) |
58 |
| - |
59 |
| -##Contributing |
| 58 | + * [Pull Requests](https://github.com/traderinteractive/mongo-queue-php/pulls) |
| 59 | + * [Issues](https://github.com/traderinteractive/mongo-queue-php/issues) |
60 | 60 |
|
| 61 | +## Contributing |
61 | 62 | If you would like to contribute, please use our build process for any changes
|
62 |
| -and after the build passes, send us a pull request on github! The build |
63 |
| -requires a running mongo. The URI to mongo can be specified via an environment |
64 |
| -variable or left to its default (localhost on the default port, 27017): |
| 63 | +and after the build passes, send us a pull request on github! |
65 | 64 | ```sh
|
66 |
| -TESTING_MONGO_URL=mongodb://127.0.0.1:27017 ./build.php |
| 65 | +./vendor/bin/phpunit |
| 66 | +./vendor/bin/phpcs |
67 | 67 | ```
|
68 | 68 |
|
69 | 69 | There is also a [docker](http://www.docker.com/)-based
|
70 |
| -[fig](http://www.fig.sh/) configuration that will standup a docker container |
71 |
| -for the database, execute the build inside a docker container, and then |
72 |
| -terminate everything. This is an easy way to build the application: |
| 70 | +[fig](http://www.fig.sh/) configuration that will execute the build inside a |
| 71 | +docker container. This is an easy way to build the application: |
73 | 72 | ```sh
|
74 | 73 | fig run build
|
75 | 74 | ```
|
0 commit comments