2017 © Pedro Peláez
 

library laravel-database-queue

image

diegowazevedo/laravel-database-queue

  • Friday, January 27, 2017
  • by diegowazevedo
  • Repository
  • 1 Watchers
  • 0 Stars
  • 77 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 11 Forks
  • 0 Open issues
  • 20 Versions
  • 0 % Grown

The README.md

Laravel 4 Database Queue Driver

Push a function/closure to the Database queue.

This is a real queue driver, like beanstalkd or redis one. You need a daemon like supervisor or similar to listen to your queue., (*1)

Install

Add the package to the require section of your composer.json and run composer update, (*2)

"diegowazevedo/laravel-database-queue": ">0.5"

Add the Service Provider to the providers array in config/app.php, (*3)

'DWA\Queue\DatabaseServiceProvider'

I suggest to publish migrations, so they are copied to your regular migrations, (*4)

$ php artisan migrate:publish diegowazevedo/laravel-database-queue

And then run migrate, (*5)

$ php artisan migrate 

I suggest to create the failed_jobs table, in this moment, with:, (*6)

$ php artisan queue:failed-table

You should now be able to use the database driver in config/queue.php, (*7)

'default' => 'database',

'connections' => array(
    ...
    'database' => array(
        'driver' => 'database',
        'queue' => 'queue-name', // optional, can be null or any string
        'lock_type' => 0, // optional, can be 0, 1 or 2
    ),
    ...
}

It work in the same as beanstalkd or redis queue listener., (*8)

Listen for new job:, (*9)

$ php artisan queue:listen

Concurrency are managed by status column in the queues table, so you can parallelize your queue:listen., (*10)

Atomicity of status change are garantee by database transaction, if you are having problems of race condition can You set the option lock_type to:, (*11)

  • 'lock_type' => 1 // queue system will use sharedLock
  • 'lock_type' => 2 // queue system will use lockForUpdate

see http://laravel.com/docs/4.2/queries#pessimistic-locking for further info., (*12)

Laravel Queue System

For more info see http://laravel.com/docs/queues, (*13)

Thanks

Loosely based on https://github.com/barryvdh/laravel-async-queue, (*14)

The Versions

27/01 2017

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

 

by Diego Azevedo

27/01 2017

0.6.1

0.6.1.0

  Sources   Download

MIT

The Requires

 

by Diego Azevedo

27/01 2017

v0.6.0

0.6.0.0

  Sources   Download

MIT

The Requires

 

by Diego Azevedo

16/10 2015

0.5.5

0.5.5.0

  Sources   Download

MIT

The Requires

 

by David Lippi

16/10 2015

0.5.4

0.5.4.0

  Sources   Download

MIT

The Requires

 

by David Lippi

16/10 2015

0.5.3

0.5.3.0

  Sources   Download

MIT

The Requires

 

by David Lippi

16/10 2015

0.5.2

0.5.2.0

  Sources   Download

MIT

The Requires

 

by David Lippi

07/07 2015

0.5.1

0.5.1.0

  Sources   Download

MIT

The Requires

 

by David Lippi

07/07 2015

0.5.0

0.5.0.0

  Sources   Download

MIT

The Requires

 

by David Lippi

23/06 2015

0.4.1

0.4.1.0

  Sources   Download

MIT

The Requires

 

by David Lippi

13/04 2015

0.4.0

0.4.0.0

  Sources   Download

MIT

The Requires

 

by David Lippi

01/04 2015

0.3.3

0.3.3.0

  Sources   Download

MIT

The Requires

 

by David Lippi

01/04 2015

0.3.2

0.3.2.0

  Sources   Download

MIT

The Requires

 

by David Lippi

01/04 2015

0.3.1

0.3.1.0

  Sources   Download

MIT

The Requires

 

by David Lippi

04/03 2015

0.3.0

0.3.0.0

  Sources   Download

MIT

The Requires

 

by David Lippi

24/11 2014

0.2.3

0.2.3.0

  Sources   Download

MIT

The Requires

 

by David Lippi

24/11 2014

0.2.2

0.2.2.0

  Sources   Download

The Requires

 

by David Lippi

19/11 2014

0.2.1

0.2.1.0

  Sources   Download

The Requires

 

by David Lippi

19/11 2014

0.1.4

0.1.4.0

  Sources   Download

The Requires

 

by David Lippi

19/11 2014

0.1.0

0.1.0.0

  Sources   Download

The Requires

 

by David Lippi