2017 © Pedro Peláez
 

library laravel-nsq

Nsq driver for Laravel Queue

image

jiyis/laravel-nsq

Nsq driver for Laravel Queue

  • Wednesday, July 4, 2018
  • by jiyis
  • Repository
  • 4 Watchers
  • 2 Stars
  • 296 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 1544 % Grown

The README.md

Laravel Nsq Client

NSQ client for laravel, (*1)

Requirements

Dependency Requirement
PHP >= 7.1.0
Swoole The Newer The Better No longer support PHP5 since 2.0.12

Installation

pecl install swoole

``` composer require jiyis/laravel-nsq, (*2)


## Usage #### Set env

NSQSD_URL=127.0.0.1:4150 NSQLOOKUP_URL=127.0.0.1:4161, (*3)

If it is multiple, please separate them with ","

NSQSD_URL=127.0.0.1:4150,127.0.0.1:4250, (*4)

#### Create Job

php artisan make:job NsqTestJob, (*5)

you need set two property. `public $topic;` `public $channel;`
```php
class NsqTestJob  implements ShouldQueue
{

    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    public $topic = 'test';

    public $channel = 'web';

    public function handle()
    {
        $client = $this->job->getCurrentClient();
        $payload = json_decode($this->job->getMessage(), true);
        ...
    }
}

Publish

// the data you want to be publish 
$str = [
    'message' => 'this is a message',
    'user_id' => 1
];
// not supported dispatch
Queue::connection('nsq')->push(new NsqTestJob, $str);

Subscribe

php artisan queue:work nsq --sleep=3 --tries=3 --timeout=500  --job=App\\Jobs\\NsqTestJob  

The Versions

04/07 2018

dev-master

9999999-dev

Nsq driver for Laravel Queue

  Sources   Download

MIT

The Requires

 

The Development Requires

by Gary F Dong

14/06 2018

1.0.1

1.0.1.0

Nsq driver for Laravel Queue

  Sources   Download

MIT

The Requires

 

The Development Requires

by Gary F Dong

23/05 2018

1.0.0

1.0.0.0

Nsq driver for Laravel Queue

  Sources   Download

MIT

The Requires

 

The Development Requires

by Gary F Dong