2017 © Pedro Peláez
 

library php-resque-ex

Redis backed library for creating background jobs and processing them later. PHP port based on resque for Ruby.

image

kamisama/php-resque-ex

Redis backed library for creating background jobs and processing them later. PHP port based on resque for Ruby.

  • Monday, January 25, 2016
  • by kamisama
  • Repository
  • 21 Watchers
  • 140 Stars
  • 243,180 Installations
  • PHP
  • 14 Dependents
  • 4 Suggesters
  • 89 Forks
  • 17 Open issues
  • 27 Versions
  • 6 % Grown

The README.md

Resque is a Redis-backed library for creating background jobs, placing those jobs on multiple queues, and processing them later., (*1)

Background

Php-Resque-Ex is a fork of php-resque by chrisboulton. See the original README for more informations., (*2)

Additional features

This fork provides some additional features :, (*3)

Support of php-redis

Autodetect and use phpredis to connect to Redis if available. Redisent is used as fallback., (*4)

Powerfull logging

Instead of piping STDOUT output to a file, you can log directly to a database, or send them elsewhere via a socket. We use Monolog to manage all the logging. See their documentation to see all the available handlers., (*5)

Log infos are augmented with more informations, and associated with a workers, a queue, and a job ID if any., (*6)

Job creation delegation

If Resque_Job_Creator class exists and is found by Resque, all jobs creation will be delegated to this class., (*7)

The best way to inject this class is to include it in you APP_INCLUDE file., (*8)

Class content is :, (*9)

class Resque_Job_Creator
{
    public static function createJob($className, $args) {

        // $className is you job class name, the second arguments when enqueuing a job
        // $args are the arguments passed to your jobs

        // Instanciate your class, and return the instance

        return new $className();
    }
}

This is pretty useful when your autoloader can not load the class, like when classname doesn't match its filename. Some framework, like CakePHP, uses PluginName.ClassName convention for classname, and require special handling before loading., (*10)

Failed jobs logs

You can easily retrieve logs for a failed jobs in the redis database, their keys are named after their job ID. Each failed log will expire after 2 weeks to save space., (*11)

Command Line tool

Fresque is shipped by default to manage your workers. See Fresque Documentation for usage., (*12)

Installation

Clone the git repo, (*13)

$ git clone git://github.com/wa0x6e/php-resque-ex.git

cd into the folder you just cloned, (*14)

$ cd ./php-resque-ex

Download Composer, (*15)

$ curl -s https://getcomposer.org/installer | php

Install dependencies, (*16)

$ php composer.phar install

Warning

php-resque requires the pcntl php extension, not available on Windows platform. Composer installation will fail if you're trying to install this package on Windows machine. If you still want to continue with the installation at your own risk, execute the composer install command with the --ignore-platform-reqs option., (*17)

Usage

Logging

Use the same way as the original port, with additional ENV :, (*18)

  • LOGHANDLER : Specify the handler to use for logging (File, MongoDB, Socket, etc …). See Monolog doc for all available handlers. LOGHANDLER is the name of the handler, without the "Handler" part. To use CubeHandler, just type "Cube".
  • LOGHANDLERTARGET : Information used by the handler to connect to the database. Depends on the type of loghandler. If it's the RotatingFileHandler, the target will be the filename. If it's CubeHandler, target will be a udp address. Refer to each Handler to see what type of argument their __construct() method requires.
  • LOGGING : This environment variable must be set in order to enable logging via Monolog. i.e LOGGING=1

If one of these two environement variable is missing, it will default to RotatingFile Handler., (*19)

Redis backend

  • REDIS_BACKEND : hostname of your Redis database
  • REDIS_DATABASE : To select another redis database (default 0)
  • REDIS_NAMESPACE : To set a different namespace for the keys (default to resque)
  • REDIS_PASSWORD : If your Redis backend needs authentication

Requirements

  • PHP 5.3+
  • Redis 2.2+

Contributors

The Versions

25/01 2016

dev-master

9999999-dev http://www.github.com/kamisama/php-resque-ex/

Redis backed library for creating background jobs and processing them later. PHP port based on resque for Ruby.

  Sources   Download

MIT

The Requires

 

php redis queue job background resque

29/01 2015

1.3.0

1.3.0.0 http://www.github.com/kamisama/php-resque-ex/

Redis backed library for creating background jobs and processing them later. PHP port based on resque for Ruby.

  Sources   Download

MIT

The Requires

 

php redis queue job background resque

15/10 2013

1.2.7

1.2.7.0 http://www.github.com/kamisama/php-resque-ex/

Redis backed library for creating background jobs and processing them later. PHP port based on resque for Ruby.

  Sources   Download

MIT

The Requires

 

php redis queue job background resque

20/06 2013

1.2.6

1.2.6.0 http://www.github.com/kamisama/php-resque-ex/

Redis backed library for creating background jobs and processing them later. PHP port based on resque for Ruby.

  Sources   Download

MIT

The Requires

 

php redis queue job background resque

22/05 2013

1.2.5

1.2.5.0 http://www.github.com/kamisama/php-resque-ex/

Redis backed library for creating background jobs and processing them later. PHP port based on resque for Ruby.

  Sources   Download

MIT

The Requires

 

php redis queue job background resque

15/04 2013

1.2.4

1.2.4.0 http://www.github.com/kamisama/php-resque-ex/

Redis backed library for creating background jobs and processing them later. PHP port based on resque for Ruby.

  Sources   Download

MIT

The Requires

 

php redis queue job background resque

31/01 2013

1.2.3

1.2.3.0 http://www.github.com/kamisama/php-resque-ex/

Redis backed library for creating background jobs and processing them later. PHP port based on resque for Ruby.

  Sources   Download

MIT

The Requires

 

php redis queue job background resque

31/01 2013

1.2.2

1.2.2.0 http://www.github.com/kamisama/php-resque-ex/

Redis backed library for creating background jobs and processing them later. PHP port based on resque for Ruby.

  Sources   Download

MIT

The Requires

 

php redis queue job background resque

30/01 2013

1.0.16

1.0.16.0 http://www.github.com/kamisama/php-resque-ex/

Redis backed library for creating background jobs and processing them later. PHP port based on resque for Ruby.

  Sources   Download

MIT

The Requires

 

php redis queue job background resque

30/01 2013

1.2.1

1.2.1.0 http://www.github.com/kamisama/php-resque-ex/

Redis backed library for creating background jobs and processing them later. PHP port based on resque for Ruby.

  Sources   Download

MIT

The Requires

 

php redis queue job background resque

23/01 2013

1.0.15

1.0.15.0 http://www.github.com/kamisama/php-resque-ex/

Redis backed library for creating background jobs and processing them later. PHP port based on resque for Ruby.

  Sources   Download

MIT

The Requires

 

php redis queue job background resque

23/10 2012

dev-dev

dev-dev http://www.github.com/kamisama/php-resque-ex/

Redis backed library for creating background jobs and processing them later. PHP port based on resque for Ruby.

  Sources   Download

MIT

The Requires

 

php redis queue job background resque

23/10 2012

1.0.14

1.0.14.0 http://www.github.com/kamisama/php-resque-ex/

Redis backed library for creating background jobs and processing them later. PHP port based on resque for Ruby.

  Sources   Download

MIT

The Requires

 

php redis queue job background resque

17/10 2012

1.0.13

1.0.13.0 http://www.github.com/kamisama/php-resque-ex/

Redis backed library for creating background jobs and processing them later. PHP port based on resque for Ruby.

  Sources   Download

MIT

The Requires

 

php redis queue job background resque

15/10 2012

1.0.12

1.0.12.0 http://www.github.com/kamisama/php-resque-ex/

Redis backed library for creating background jobs and processing them later. PHP port based on resque for Ruby.

  Sources   Download

MIT

The Requires

 

php redis queue job background resque

13/10 2012

1.2

1.2.0.0 http://www.github.com/chrisboulton/php-resque/

Redis backed library for creating background jobs and processing them later. Based on resque for Ruby.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

redis job background resque

01/10 2012

1.0.11

1.0.11.0 http://www.github.com/kamisama/php-resque-ex/

Redis backed library for creating background jobs and processing them later. PHP port based on resque for Ruby.

  Sources   Download

MIT

The Requires

 

php redis queue job background resque

27/09 2012

1.0.10

1.0.10.0 http://www.github.com/kamisama/php-resque-ex/

Redis backed library for creating background jobs and processing them later. PHP port based on resque for Ruby.

  Sources   Download

MIT

The Requires

 

php redis queue job background resque

19/09 2012

1.0.8

1.0.8.0 http://www.github.com/kamisama/php-resque-ex/

Redis backed library for creating background jobs and processing them later. PHP port based on resque for Ruby.

  Sources   Download

MIT

The Requires

 

redis queue job background resque

10/09 2012

1.0.7

1.0.7.0 http://www.github.com/kamisama/php-resque-ex/

Redis backed library for creating background jobs and processing them later. PHP port based on resque for Ruby.

  Sources   Download

MIT

The Requires

 

redis queue job background resque

10/09 2012

1.0.6

1.0.6.0 http://www.github.com/kamisama/php-resque-ex/

Redis backed library for creating background jobs and processing them later. PHP port based on resque for Ruby.

  Sources   Download

MIT

The Requires

 

redis queue job background resque

29/08 2012

1.0.5

1.0.5.0 http://www.github.com/kamisama/php-resque-ex/

Redis backed library for creating background jobs and processing them later. PHP port based on resque for Ruby.

  Sources   Download

MIT

The Requires

 

redis queue job background resque

29/08 2012

1.0.4

1.0.4.0 http://www.github.com/kamisama/php-resque-ex/

Redis backed library for creating background jobs and processing them later. PHP port based on resque for Ruby.

  Sources   Download

MIT

The Requires

 

redis queue job background resque

26/08 2012

1.0.3

1.0.3.0 http://www.github.com/kamisama/php-resque-ex/

Redis backed library for creating background jobs and processing them later. Based on resque for Ruby.

  Sources   Download

MIT

The Requires

 

redis job background resque

22/08 2012

1.0.2

1.0.2.0 http://www.github.com/kamisama/php-resque-ex/

Redis backed library for creating background jobs and processing them later. Based on resque for Ruby.

  Sources   Download

MIT

The Requires

 

redis job background resque

21/08 2012

1.0.1

1.0.1.0 http://www.github.com/kamisama/php-resque-ex/

Redis backed library for creating background jobs and processing them later. Based on resque for Ruby.

  Sources   Download

MIT

The Requires

 

redis job background resque

21/08 2012

1.0.0

1.0.0.0 http://www.github.com/kamisama/php-resque-ex/

Redis backed library for creating background jobs and processing them later. Based on resque for Ruby.

  Sources   Download

MIT

The Requires

 

redis job background resque