|
1 | | -# Laravel PubSub Queue |
2 | | - |
3 | | -[](https://github.com/kainxspirits/laravel-pubsub-queue) |
4 | | -[](https://styleci.io/repos/131718560) |
5 | | - |
6 | | -This package is a Laravel queue driver that use the [Google PubSub](https://github.com/GoogleCloudPlatform/google-cloud-php-pubsub) service. |
7 | | - |
8 | | -## Installation |
9 | | - |
10 | | -You can easily install this package with [Composer](https://getcomposer.org) by running this command : |
11 | | - |
12 | | -```bash |
13 | | -composer require kainxspirits/laravel-pubsub-queue |
14 | | -``` |
15 | | - |
16 | | -If you disabled package discovery, you can still manually register this package by adding the following line to the providers of your `config/app.php` file : |
17 | | - |
18 | | -```php |
19 | | -Kainxspirits\PubSubQueue\PubSubQueueServiceProvider::class, |
20 | | -``` |
21 | | - |
22 | | -## Configuration |
23 | | - |
24 | | -Add a `pubsub` connection to your `config/queue.php` file. From there, you can use any configuration values from the original pubsub client. Just make sure to use snake_case for the keys name. |
25 | | - |
26 | | -You can check [Google Cloud PubSub client](http://googlecloudplatform.github.io/google-cloud-php/#/docs/google-cloud/v0.62.0/pubsub/pubsubclient?method=__construct) for more details about the different options. |
27 | | - |
28 | | -```php |
29 | | -'pubsub' => [ |
30 | | - 'driver' => 'pubsub', |
31 | | - 'queue' => env('PUBSUB_QUEUE', 'default'), |
32 | | - 'project_id' => env('PUBSUB_PROJECT_ID', 'your-project-id'), |
33 | | - 'retries' => 3, |
34 | | - 'request_timeout' => 60 |
35 | | -], |
36 | | -``` |
37 | | - |
38 | | -## Testing |
39 | | - |
40 | | -You can run the tests with : |
41 | | - |
42 | | -```bash |
43 | | -vendor/bin/phpunit |
44 | | -``` |
45 | | - |
46 | | -## License |
47 | | - |
48 | | -This project is licensed under the terms of the MIT license. See [License File](LICENSE) for more information. |
| 1 | +# Laravel PubSub Queue |
| 2 | + |
| 3 | +[](https://github.com/kainxspirits/laravel-pubsub-queue) |
| 4 | +[](https://styleci.io/repos/131718560) |
| 5 | + |
| 6 | +This package is a Laravel 5.7 queue driver that use the [Google PubSub](https://github.com/GoogleCloudPlatform/google-cloud-php-pubsub) service. |
| 7 | + |
| 8 | +## Installation |
| 9 | + |
| 10 | +You can easily install this package with [Composer](https://getcomposer.org) by running this command : |
| 11 | + |
| 12 | +```bash |
| 13 | +composer require kainxspirits/laravel-pubsub-queue |
| 14 | +``` |
| 15 | + |
| 16 | +If you disabled package discovery, you can still manually register this package by adding the following line to the providers of your `config/app.php` file : |
| 17 | + |
| 18 | +```php |
| 19 | +Kainxspirits\PubSubQueue\PubSubQueueServiceProvider::class, |
| 20 | +``` |
| 21 | + |
| 22 | +## Configuration |
| 23 | + |
| 24 | +Add a `pubsub` connection to your `config/queue.php` file. From there, you can use any configuration values from the original pubsub client. Just make sure to use snake_case for the keys name. |
| 25 | + |
| 26 | +You can check [Google Cloud PubSub client](http://googlecloudplatform.github.io/google-cloud-php/#/docs/google-cloud/v0.62.0/pubsub/pubsubclient?method=__construct) for more details about the different options. |
| 27 | + |
| 28 | +```php |
| 29 | +'pubsub' => [ |
| 30 | + 'driver' => 'pubsub', |
| 31 | + 'queue' => env('PUBSUB_QUEUE', 'default'), |
| 32 | + 'project_id' => env('PUBSUB_PROJECT_ID', 'your-project-id'), |
| 33 | + 'retries' => 3, |
| 34 | + 'request_timeout' => 60 |
| 35 | +], |
| 36 | +``` |
| 37 | + |
| 38 | +## Testing |
| 39 | + |
| 40 | +You can run the tests with : |
| 41 | + |
| 42 | +```bash |
| 43 | +vendor/bin/phpunit |
| 44 | +``` |
| 45 | + |
| 46 | +## License |
| 47 | + |
| 48 | +This project is licensed under the terms of the MIT license. See [License File](LICENSE) for more information. |
0 commit comments