Download the PHP package bprs/resque without Composer

On this page you can find all versions of the php package bprs/resque. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package resque

Resque for PHP

About

This is a fork of the vent/resque repo on https://github.com/vend/php-resque. The idea is to improve on the package without the need to rely on implementations of vent. It seems the development on the original bundle (chrisboulton/php-resque) and vend stopped a long time ago. The namespacing seems to be a huge improvement over the original implementation. Future updates will include dequeueing and more.

Namespaced Fork

Build Status Latest Stable Version Latest Unstable Version License

Resque is a Redis-backed library for creating background jobs, placing those jobs on one or more queues, and processing them later.

This is a PHP fork of the Resque worker and job classes. This makes it compatible with the resque-web interface, and with other Resque libraries. (You could enqueue jobs from Ruby and dequeue them in PHP, for instance).

This library (vend/resque) is a fork of chrisboulton/php-resque at around version 1.3, that has been refactored to remove global state, add namespacing, and improve decoupling. This makes it easier to use and extend.

Getting Started

Add vend/resque to your application's composer.json.

Requirements

Jobs

Queueing Jobs

Jobs are queued as follows:

In order the arguments are: queue, job class, job payload, whether to enable tracking.

Defining Jobs

Each job should be in its own class, and implement the Resque\JobInterface. (This is pretty easy, and only really requires a single custom method: perform().) Most of the time, you'll want to use the default implementation of a Job, and extend the Resque\AbstractJob instead of implementing the interface yourself:

Any exception thrown by a job will result in the job failing - be careful here and make sure you handle the exceptions that shouldn't result in a job failing.

Job Status Tracking

vend/resque has the ability to perform basic status tracking of a queued job. The status information will allow you to check if a job is in the queue, is currently being run, has finished, or has failed.

To track the status of a job, pass true as the fourth argument to Resque\Resque::enqueue. An ID used for tracking the job status will be returned:

To fetch the status of a job:

The Status object contains methods for adding other attributes to the tracked status. (For instance, you might use the status object to track errors, completion information, iterations, etc.)

Statuses

Job statuses are defined as constants in the Resque\Job\Status class. Valid statuses include:

Statuses are available for up to 24 hours after a job has completed or failed, and are then automatically expired. A status can also forcefully be expired by calling the stop() method on a status class.

Console

You are free you implement your own daemonization/worker pool strategy by subclassing the Worker class. For playing around, and low throughput applications, you might like to use the built-in console commands.

This version of the library uses the Symfony2 Console component. But it must be configured with the details of your Redis connection. We do this in much the same way that the Doctrine2 Console component gets details of your database connection: via a cli-config.php file.

There is an example cli-config.php in this repository.

If you're running a full-stack web application, you'd generally use your locator/service container to fill in the Redis client connection in this file. (The default is to use Predis, and to connect to 127.0.0.1:6379).

Basic Usage

Enqueueing

This command will enqueue a Some\Test\Job job onto the default queue. Watch out for the single quotes around the class name: when specifying backslashes on the command line, you'll probably have to avoid your shell escaping them.

Worker

This command will run a simple pre-forking worker on two queues:

(-q means quiet, -Q specifies queues). You can also specify no queues, or the special queue '*' (watch for shell expansion).

Queue Information

There are a couple of useful commands for getting information about the queues. This will show a list of queues and how many jobs are waiting on each:

This command will clear a specified queue:

Logging

The library now uses PSR3. When running as a console component, you can customise the logger to use in cli-config.php. (For instance, you might like to send your worker logs to Monolog.)

Why Fork?

Unfortunately, several things about the existing versions of php-resque made it a candidate for refactoring:

Contributors

Here's the contributor list from earlier versions, at chrisboulton/php-resque:


All versions of resque with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
ext-pcntl Version *
predis/predis Version >=0.8
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bprs/resque contains the following files

Loading the files please wait ....