PHPackages                             catch-of-the-day/php-resque-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. catch-of-the-day/php-resque-bundle

ActiveSymfony-bundle

catch-of-the-day/php-resque-bundle
==================================

042.7kPHP

Since Aug 28Pushed 2y ago23 watchersCompare

[ Source](https://github.com/CatchoftheDay/php-resque-bundle)[ Packagist](https://packagist.org/packages/catch-of-the-day/php-resque-bundle)[ RSS](/packages/catch-of-the-day-php-resque-bundle/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (3)Used By (0)

PHP-Resque Bundle for Symfony 2
===============================

[](#php-resque-bundle-for-symfony-2)

PHPResqueBundle is an derivation of php-resque project .

This bundle supports all features from php-resque project. It's includes: workers, enqueues, fork workers, events, namespaces, etc.

Install
-------

[](#install)

This project uses the composer project to install dependencies. Look in the composer.json file to install the dependencies required.

How it works
------------

[](#how-it-works)

### Worker

[](#worker)

To start a worker you need:

```
    $ php app/console resque:worker

```

This will start a worker for 'default' queue at 'resque' namespace with normal log output with interval of 5 seconds between interations. But, of course you can change this with optional arguments:

```
    --log (verbose|normal|none)
    --interval 1..n
    --forkCount 0..n (this will require a PECL module )
    [queue_name] separated by commas if you want to work with more than one queue.

```

So, if you want to work with 'mailer' and 'news\_subscriptions' queues with 10 seconds of interval between interactions in a verbose output:

```
    $ php app/console resque:worker --log verbose --interval 10 mailer,news_subscriptions

```

NAMESPACE Support:

If you have the following namespaces: php, resque For 'php' namespace you have: mailer queue. For 'resque' namespace you have: news, parser, ftp queues.

To run only php namespace you should do:

```
    $ php app/console resque:worker "php:*"

```

To run only 'ftp' and 'parser' queues on "resque" namespace:

```
    $ php app/console resque:worker resque:ftp,parser

```

For more information you can run:

```
    $ php app/console resque:worker --help

```

### Queue

[](#queue)

Attach a Job at default queue

```
    $ php app/console resque:queue Namespace\\Of\\Class\\SomeJob

```

You can define which queue with optional argument \[queue\_name\]. To put 'SomeJob' into 'mailer' queue:

```
    $ php app/console resque:queue Namespace\\Of\\Class\SomeJob mailer

```

If you use namespaces:

```
    $ php app/console resque:queue Namespace\\Of\\Class\SomeJob your_namespace:mailer

```

Attach a Job using Queue class (PHPResqueBundle\\Resque namespace):

```
