Skip to content

Commit 48b89d7

Browse files
authored
Change queue version number and handle the breaking change
1 parent 3826f14 commit 48b89d7

File tree

3 files changed

+102
-102
lines changed

3 files changed

+102
-102
lines changed

README.md

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,48 @@
1-
# Laravel PubSub Queue
2-
3-
[![Travis](https://img.shields.io/travis/kainxspirits/laravel-pubsub-queue.svg)](https://github.com/kainxspirits/laravel-pubsub-queue)
4-
[![StyleCI](https://styleci.io/repos/131718560/shield)](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+
[![Travis](https://img.shields.io/travis/kainxspirits/laravel-pubsub-queue.svg)](https://github.com/kainxspirits/laravel-pubsub-queue)
4+
[![StyleCI](https://styleci.io/repos/131718560/shield)](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.

composer.json

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,49 @@
1-
{
2-
"name": "kainxspirits/laravel-pubsub-queue",
3-
"description": "Queue driver for Google Cloud Pub/Sub.",
4-
"keywords": [
5-
"kainxspirits",
6-
"laravel",
7-
"queue",
8-
"gcp",
9-
"google",
10-
"pubsub"
11-
],
12-
"license": "MIT",
13-
"type": "library",
14-
"authors": [
15-
{
16-
"name": "Kendryck",
17-
"email": "kainxspirits@users.noreply.github.com"
18-
}
19-
],
20-
"require": {
21-
"php" : ">=7.1",
22-
"illuminate/queue": "^5.6",
23-
"google/cloud-pubsub": "^1.1"
24-
},
25-
"require-dev": {
26-
"phpunit/phpunit": "^7.1"
27-
},
28-
"autoload": {
29-
"psr-4": {
30-
"Kainxspirits\\PubSubQueue\\": "src/"
31-
}
32-
},
33-
"autoload-dev": {
34-
"psr-4": {
35-
"Kainxspirits\\PubSubQueue\\Tests\\": "tests/"
36-
}
37-
},
38-
"scripts": {
39-
"test": "vendor/bin/phpunit"
40-
},
41-
"extra": {
42-
"laravel": {
43-
"providers": [
44-
"Kainxspirits\\PubSubQueue\\PubSubQueueServiceProvider"
45-
]
46-
}
47-
},
48-
"minimum-stability": "stable"
49-
}
1+
{
2+
"name": "kainxspirits/laravel-pubsub-queue",
3+
"description": "Queue driver for Google Cloud Pub/Sub.",
4+
"keywords": [
5+
"kainxspirits",
6+
"laravel",
7+
"queue",
8+
"gcp",
9+
"google",
10+
"pubsub"
11+
],
12+
"license": "MIT",
13+
"type": "library",
14+
"authors": [
15+
{
16+
"name": "Kendryck",
17+
"email": "kainxspirits@users.noreply.github.com"
18+
}
19+
],
20+
"require": {
21+
"php" : ">=7.1",
22+
"illuminate/queue": "~5.7.0",
23+
"google/cloud-pubsub": "^1.1"
24+
},
25+
"require-dev": {
26+
"phpunit/phpunit": "^7.1"
27+
},
28+
"autoload": {
29+
"psr-4": {
30+
"Kainxspirits\\PubSubQueue\\": "src/"
31+
}
32+
},
33+
"autoload-dev": {
34+
"psr-4": {
35+
"Kainxspirits\\PubSubQueue\\Tests\\": "tests/"
36+
}
37+
},
38+
"scripts": {
39+
"test": "vendor/bin/phpunit"
40+
},
41+
"extra": {
42+
"laravel": {
43+
"providers": [
44+
"Kainxspirits\\PubSubQueue\\PubSubQueueServiceProvider"
45+
]
46+
}
47+
},
48+
"minimum-stability": "stable"
49+
}

src/PubSubQueue.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function size($queue = null)
6262
*/
6363
public function push($job, $data = '', $queue = null)
6464
{
65-
return $this->pushRaw($this->createPayload($job, $data), $queue);
65+
return $this->pushRaw($this->createPayload($job, $queue, $data), $queue);
6666
}
6767

6868
/**
@@ -102,7 +102,7 @@ public function pushRaw($payload, $queue = null, array $options = [])
102102
public function later($delay, $job, $data = '', $queue = null)
103103
{
104104
return $this->pushRaw(
105-
$this->createPayload($job, $data),
105+
$this->createPayload($job, $queue, $data),
106106
$queue,
107107
['available_at' => $this->availableAt($delay)]
108108
);
@@ -153,7 +153,7 @@ public function bulk($jobs, $data = '', $queue = null)
153153
$payloads = [];
154154

155155
foreach ((array) $jobs as $job) {
156-
$payloads[] = ['data' => $this->createPayload($job, $data)];
156+
$payloads[] = ['data' => $this->createPayload($job, $queue, $data)];
157157
}
158158

159159
$topic = $this->getTopic($queue, true);
@@ -203,9 +203,9 @@ public function acknowledgeAndPublish(Message $message, $queue = null, $options
203203
/**
204204
* {@inheritdoc}
205205
*/
206-
protected function createPayload($job, $data = '')
206+
protected function createPayload($job, $queue = null, $data = '')
207207
{
208-
$payload = parent::createPayload($job, $data);
208+
$payload = parent::createPayload($job, $queue, $data);
209209

210210
return base64_encode($payload);
211211
}

0 commit comments

Comments
 (0)