2017 © Pedro Peláez
 

library bredis

Long polling (blocking pop) for Redis queue driver in Laravel

image

halaei/bredis

Long polling (blocking pop) for Redis queue driver in Laravel

  • Saturday, September 23, 2017
  • by halaei
  • Repository
  • 1 Watchers
  • 2 Stars
  • 585 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 2 Open issues
  • 4 Versions
  • 15 % Grown

The README.md

bredis queue driver for Laravel

Build Status Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

When do you need bredis?

You need bredis when all of these are applied:, (*2)

  1. You don't want your jobs to be delayed because your workers are currently sleeping.
  2. You don't want to run queue:work --sleep=0 on current Redis queue driver because it will devour your CPU when there is no job.

Hence, you need your workers to idle-wait for a job and process them just when they arrive, with nearly no delay. With bredis you can happily run queue:work --sleep=0 without worrying about busy waiting and CPU overload., (*3)

Installation

1. Install the package via compioser

composer require halaei/bredis

2. Add the service provider to your config/app.php

Halaei\BRedis\BlockingRedisServiceProvider::class

3. Add bredis connections to app/queue.php

'bredis' => [
    'driver'      => 'bredis',
    'connection'  => 'default',
    'queue'       => 'default',
    'retry_after' => 90,
    'timeout'     => 10, //Maximum seconds to wait for a job
],

Please note that if you need to increase 'timeout' in the config array above, you should increase 'retry_after' in the array as well as --timeout in your queue:work commands., (*4)

Warning: bredis queue workers don't bother handling jobs that are delayed or reserved. So when using bredis workers, you have to have at least one redis worker as well., (*5)

Note: bredis queue driver is 100% compatible with redis driver. In other words, you may push the jobs using redis driver and pop them using bredis, or vice versa., (*6)

The Versions

23/09 2017

dev-master

9999999-dev

Long polling (blocking pop) for Redis queue driver in Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Hamid Alaei V.

laravel redis queue long polling blocking pop

23/09 2017

3.0.0

3.0.0.0

Long polling (blocking pop) for Redis queue driver in Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Hamid Alaei V.

laravel redis queue long polling blocking pop

08/02 2017

2.0.0

2.0.0.0

Long polling (blocking pop) for Redis queue driver in Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Hamid Alaei V.

laravel redis queue long polling blocking pop

20/09 2016

1.0.0

1.0.0.0

Long polling (blocking pop) for Redis queue driver in Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by Hamid Alaei V.

laravel redis queue long polling blocking pop