Coder Social home page Coder Social logo

michelsalib / bccresquebundle Goto Github PK

View Code? Open in Web Editor NEW
123.0 10.0 92.0 279 KB

The BCC resque bundle provides integration of php-resque to Symfony2. It is inspired from resque, a Redis-backed Ruby library for creating background jobs, placing them on multiple queues, and processing them later.

PHP 78.26% HTML 21.74%

bccresquebundle's Introduction

Intro to BCCResqueBundle

The BCC resque bundle provides integration of php-resque to Symfony2. It is inspired from resque, a Redis-backed Ruby library for creating background jobs, placing them on multiple queues, and processing them later.

Features:

  • Creating a Job, with container access in order to leverage your Symfony services
  • Enqueue a Job with parameters on a given queue
  • Creating background worker on a given queue
  • A UX to monitor your queues, workers and job statuses
  • ability to schedule jobs to run at a specific time or after a number of seconds delay
  • ability to auto re-queue failed jobs, with back-off strategies

TODOs:

  • Log management
  • Job status tracking
  • Redis configuration
  • Localisation
  • Tests

Screenshots

Dashboard

Installation and configuration:

Requirements

Make sure you have redis installed on your machine: http://redis.io/

Get the bundle

Add to your bcc-resque-bundle to your dependencies:

{
    "require": {
        ...
        "bcc/resque-bundle": "dev-master"
    }
    ...
}

To install, run php composer.phar [update|install].

Add BCCResqueBundle to your application kernel

<?php

    // app/AppKernel.php
    public function registerBundles()
    {
        return array(
            // ...
            new BCC\ResqueBundle\BCCResqueBundle(),
            // ...
        );
    }

Import the routing configuration

Add to your routing.yml:

# app/config/routing.yml
BCCResqueBundle:
    resource: "@BCCResqueBundle/Resources/config/routing.xml"
    prefix:   /resque

You can customize the prefix as you wish.

You can now access the dashboard at this url: /resque

To secure the dashboard, you can add the following to your security.yml - provided your administrator role is ROLE_ADMIN

    access_control:
        - { path: ^/resque, roles: ROLE_ADMIN }

Optional, secure the dashboard behind a role

Add to your security.yml:

# app/config/security.yml
access_control:
    - { path: ^/resque, roles: ROLE_ADMIN }

Now only users with the role ROLE_ADMIN will be able to access the dashboard at this url: /resque

Optional, set configuration

You may want to add some configuration to your config.yml

# app/config/config.yml
bcc_resque:
    class: BCC\ResqueBundle\Resque           # the resque class if different from default
    vendor_dir: %kernel.root_dir%/../vendor  # the vendor dir if different from default
    prefix: my-resque-prefix                 # optional prefix to separate Resque data per site/app
    redis:
        host: localhost                      # the redis host
        port: 6379                           # the redis port
        database: 1                          # the redis database
    auto_retry: [0, 10, 60]                  # auto retry failed jobs
    worker:
        root_dir: path/to/worker/root        # the root dir of app that run workers (optional)

See the Auto retry section for more on how to use auto_retry.

Set worker: root_dir: in case job fails to run when worker systems are hosted on separate server/dir from the system creating the queue. When running multiple configured apps for multiple workers, all apps must be able to access by the same root_dir defined in worker: root_dir.

Optional, configure lazy loading

This bundle is prepared for lazy loading in order to make a connection to redis only when its really used. Symfony2 supports that starting with 2.3. To make it work an additional step needs to be done. You need to install a proxy manager to your Symfony2 project. The full documentation for adding the proxy manager can be found in Symfony2's Lazy Service documentation.

Creating a Job

A job is a subclass of the BCC\ResqueBundle\Job class. You also can use the BCC\Resque\ContainerAwareJob if you need to leverage the container during job execution. You will be forced to implement the run method that will contain your job logic:

<?php

namespace My;

use BCC\ResqueBundle\Job;

class MyJob extends Job
{
    public function run($args)
    {
        \file_put_contents($args['file'], $args['content']);
    }
}

As you can see you get an $args parameter that is the array of arguments of your Job.

Adding a job to a queue

You can get the resque service simply by using the container. From your controller you can do:

<?php

// get resque
$resque = $this->get('bcc_resque.resque');

// create your job
$job = new MyJob();
$job->args = array(
    'file'    => '/tmp/file',
    'content' => 'hello',
);

// enqueue your job
$resque->enqueue($job);

Running a worker on a queue

Executing the following commands will create a work on :

  • the default queue : app/console bcc:resque:worker-start default
  • the q1 and q2 queue : app/console bcc:resque:worker-start q1,q2 (separate name with ,)
  • all existing queues : app/console bcc:resque:worker-start "*"

You can also run a worker foreground by adding the --foreground option;

By default VERBOSE environment variable is set when calling php-resque

  • --verbose option sets VVERBOSE
  • --quiet disables both so no debug output is thrown

See php-resque logging option : https://github.com/chrisboulton/php-resque#logging

Adding a delayed job to a queue

You can specify that a job is run at a specific time or after a specific delay (in seconds).

From your controller you can do:

<?php

// get resque
$resque = $this->get('bcc_resque.resque');

// create your job
$job = new MyJob();
$job->args = array(
    'file'    => '/tmp/file',
    'content' => 'hello',
);

// enqueue your job to run at a specific \DateTime or int unix timestamp
$resque->enqueueAt(\DateTime|int $at, $job);

// or

// enqueue your job to run after a number of seconds
$resque->enqueueIn($seconds, $job);

You must also run a scheduledworker, which is responsible for taking items out of the special delayed queue and putting them into the originally specified queue.

app/console bcc:resque:scheduledworker-start

Stop it later with app/console bcc:resque:scheduledworker-stop.

Note that when run in background mode it creates a PID file in 'cache//bcc_resque_scheduledworker.pid'. If you clear your cache while the scheduledworker is running you won't be able to stop it with the scheduledworker-stop command.

Alternatively, you can run the scheduledworker in the foreground with the --foreground option.

Note also you should only ever have one scheduledworker running, and if the PID file already exists you will have to use the --force option to start a scheduledworker.

Manage production workers with supervisord

It's probably best to use supervisord (http://supervisord.org) to run the workers in production, rather than re-invent job spawning, monitoring, stopping and restarting.

Here's a sample conf file

[program:myapp_phpresque_default]
command = /usr/bin/php /home/sites/myapp/prod/current/vendor/bcc/resque-bundle/BCC/ResqueBundle/bin/resque
user = myusername
environment = APP_INCLUDE='/home/sites/myapp/prod/current/vendor/autoload.php',VERBOSE='1',QUEUE='default'
stopsignal=QUIT

[program:myapp_phpresque_scheduledworker]
command = /usr/bin/php /home/sites/myapp/prod/current/vendor/bcc/resque-bundle/BCC/ResqueBundle/bin/resque-scheduler
user = myusername
environment = APP_INCLUDE='/home/sites/myapp/prod/current/vendor/autoload.php',VERBOSE='1',RESQUE_PHP='/home/sites/myapp/prod/current/vendor/chrisboulton/php-resque/lib/Resque.php'
stopsignal=QUIT

[group:myapp]
programs=myapp_phpresque_default,myapp_phpresque_scheduledworker

(If you use a custom Resque prefix, add an extra environment variable: PREFIX='my-resque-prefix')

Then in Capifony you can do

sudo supervisorctl stop myapp:* before deploying your app and sudo supervisorctl start myapp:* afterwards.

More features

Changing the queue

You can change a job queue just by setting the queue field of the job:

From within the job:

<?php

namespace My;

use BCC\ResqueBundle\Job;

class MyJob extends Job
{
    public function __construct()
    {
        $this->queue = 'my_queue';
    }

    public function run($args)
    {
        ...
    }
}

Or from outside the job:

<?php

// create your job
$job = new MyJob();
$job->queue = 'my_queue';

Access the container from inside your job

Just extend the ContainerAwareJob:

<?php

namespace My;

use BCC\ResqueBundle\ContainerAwareJob;

class MyJob extends ContainerAwareJob
{
    public function run($args)
    {
        $doctrine = $this->getContainer()->getDoctrine();
        ...
    }
}

Stop a worker

Use the app/console bcc:resque:worker-stop command.

  • No argument will display running workers that you can stop.
  • Add a worker id to stop it: app/console bcc:resque:worker-stop ubuntu:3949:default
  • Add the --all option to stop all the workers.

Auto retry

You can have the bundle auto retry failed jobs by adding retry strategy for either a specific job, or for all jobs in general:

The following will allow Some\Job to retry 3 times.

  • right away
  • after a 10 second delay
  • after a 60 second delay
bcc_resque:
    redis:
        ....
    auto_retry:
        Some\Job: [0, 10, 60]

Setting strategy for all jobs:

bcc_resque:
    auto_retry: [0, 10, 60]

With default strategy for all but specific jobs:

bcc_resque:
    auto_retry:
    	default:        [0, 10, 60]
        Some\Job:       [0, 10, 120, 240]
        Some\Other\Job: [10, 30, 120, 600]

The default strategy (if provided) will be applied to all jobs that does not have a specific strategy attached. If not provided these jobs will not have auto retry.

You can disable auto_retry for selected jobs by using an empty array:

bcc_resque:
    auto_retry:
    	default:        [0, 10, 60]
        Some\Job:       []
        Some\Other\Job: [10, 30, 120, 600]

Here Some\Job will not have any auto_retry attached.

Please note

To use the auto_retry feature, you must also run the scheduler job:

app/console bcc:resque:scheduledworker-start

bccresquebundle's People

Contributors

cocomode18 avatar dirkaholic avatar elazer avatar eymengunay avatar kbsali avatar kgust avatar lenar avatar lightglitch avatar mhor avatar mrcmorales avatar nicolasbadey avatar ruudk avatar t3chn0r avatar tobiaskluge avatar tonypiper avatar wasigh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bccresquebundle's Issues

resque-worker not executing the ContainerAwareJob() code

Not sure what's happening now... I deployed my application into a new server, no changes to the code, no changes to the version of the bundles, same everything...

I'm putting a job in the queue, the worker sees the new job, it executes the ContainerAwareJob() (at least that's what it's saying) but nothing is happening, the job in the queue goes into "processed" but in reality nothing from the code contained in the ContainerAwareJob() was executed.

The job is trying to send an email, if it fails it updates the attempt and the error message, if it goes fine it sets a field with the dispatched date. This is a simple if() condition so whatever the outcome of the send() function sending the emails the database record has to be updated one way or the other. However, nothing is changing in the database like the code was never executed.

I added a throw Exception and even a call to an undefined function to see if it will throw an error but nothing. Every single job is set as processed though...

I'm not sure how can I debug this, or is there anything that I can look to figure out why the ContainerAwareJob() is not being executed by the resque worker.

I'll appreciated any help or pointers.

Regards,
t3chn0r

Can not stop worker

comand:
app/console bcc:resque:worker-stop -a

displayed:
Stopping 00000.net:24674:*...

but process stil working...

Cannot acces the Container in ContainerAwareJob

Hi,

I cannot use the container inside a ContainerAwareJob. What am I doing wrong?

PHP Fatal error:  Call to undefined method appDevDebugProjectContainer::getDoctrine() in ....

and my code

<?php
namespace Company\TestBundle\Job;

use BCC\ResqueBundle\ContainerAwareJob;

class TestJob extends ContainerAwareJob {

    public function __construct(){
        $this->queue = 'test';
    }

    public function run($args) {
        $doctrine = $this->getContainer()->getDoctrine()->getManager('junior');
        var_dump($doctrine);
    }
}

Thanks in advance!

Dependency issues on latest version

As stated in the doc, here is a sample composer.json :

{
    "name": "test/bccnresque",
    "description": "test bcc resque",
    "autoload": {
        "psr-0": { "": "src/" }
    },
    "require": {
        "bcc/resque-bundle": "dev-master"
    },
    "minimum-stability": "dev",
    "repositories": [
        {
            "type": "git",
            "url": "https://github.com/chrisboulton/php-resque-scheduler"
        }
    ]
}

This results in:

$ composer.phar install
Loading composer repositories with package information
Installing dependencies                                            
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - bcc/resque-bundle dev-master requires chrisboulton/php-resque-scheduler dev-master -> satisfiable by chrisboulton/php-resque-scheduler dev-master, chrisboulton/php-resque-scheduler dev-master.
    - chrisboulton/php-resque-scheduler dev-master requires chrisboulton/php-resque < 1.3 -> satisfiable by chrisboulton/php-resque 1.2.
    - chrisboulton/php-resque-scheduler dev-master requires chrisboulton/php-resque < 1.3 -> satisfiable by chrisboulton/php-resque 1.2.
    - Can only install one of: chrisboulton/php-resque dev-master, chrisboulton/php-resque 1.2.
    - bcc/resque-bundle dev-master requires chrisboulton/php-resque dev-master -> satisfiable by chrisboulton/php-resque dev-master.
    - Installation request for bcc/resque-bundle dev-master -> satisfiable by bcc/resque-bundle dev-master.

You should consider introducing tags to your project, requiring " "minimum-stability": "dev" " is bad.

Thx

stop worker all

When you stop all workers executing

bcc:resque:worker-stop --all

you should filter and only kill the ones on the machine where the script is executed.
Because now you can send kill to others services.

I will try to do a pull request ...

Worker not work, but counted as Processed

Job like:

public function run($args)
{
throw new Exception('Unable to run this job!');
}

counted as "Processed"

real work like as:
\file_put_contents($args['file'], $args['content']);

not processed, while counted as "Processed"

Debian 7, php 5.5.6-1~dotdeb.1, Symfony 2.4.0

Create job from a service

Hi,

I am able to create jobs from the controller, but how do I create a job from a service ?

I am trying to pass @bcc_resque.resque in the arguments field of my service declaration, but not sure which class would be sent as arguments in the service constructor .

Thanks

Stoping workers doesn t stop them

The command php app/console bcc:resque:worker-stop --all doesn t stop the workers

I have to stop them by console using kill -9 PID_NUMBER

Any idea ?

Add kernel loader.

I didn't found kernel load for job. So i'm doing it in every job that uses service container. It will be cool, if bundle wil provide opportunity to use kernel.

Allow retrying of failed jobs

It would be really great if we could retry failed jobs from the failed list. Also, an option for clearing all the failed jobs would be great.

Documentation on securing the route for Resque

Not an issue but maybe something that can be useful for other people, under the section "Import the routing configuration" you should add that you can protect the /resque route so only application admins can access it by adding the following to security.yml (taking into consideration that your admin role is ROLE_ADMIN for example):

    access_control:
        - { path: ^/resque, roles: ROLE_ADMIN }

Every Job Fail

Good morning.

Sorry to be bothering, but I'm new to BCCResqueBundle and I need some help.

I've created a simple job to change a file. But although the job has executed correctly and the file been updated, the job is shown as failed in the queue's entry on the dashboard.

Could you please tell me what I should do to correct this, is the job supposed to return any value?

Kind regards.

Problem with windows 7

Does this bundle working on Windows 7?

I have been run this command

php ./app/console bcc:resque:worker-start notification_queue -f --env=test

See this result:

Starting worker php D:/Projects/smart-taxi/app/../vendor/chrisboulton/php-resque/resque.php
'php' is not recognized as an internal or external command,
operable program or batch file.

Path to php exists in windows variables

P.S. Same error on other windows machine. If anyone have any thoughts, please let me know

Scheduled worker not working - error from credis

My scheduled workers do not seem to work, and I'm getting this constant error in my resque-scheduler_dev.log file :

PHP Warning:  strlen() expects parameter 1 to be string, array given in /***/vendor/colinmollenhour/credis/Client.php on line 772

I var_dumped the arguments given in the concerned _map function of credis before the error is thrown, in case this could help :

*** Prefix set to xx
*** Starting scheduler worker
string(6) "select"
int(1)
string(13) "zrangebyscore"
string(25) "xx:delayed_queue_schedule"
string(4) "-inf"
int(1390217269)
array(2) {
  [0]=>
  int(0)
  [1]=>
  int(1)
}
PHP Warning:  strlen() expects parameter 1 ... (the before-mentioned error)

I have no idea what is going on in this function and what the given array is about... Anyone else getting this error ? Not sure if the problem comes from this bundle, from php-resque or credis, so I'm trying here first.

Twig_Error_Runtime exception when showing date

Seems like the used date format is sometimes not parsable by DateTime, I regularly get 500 errors with that message in the logs:

Twig_Error_Runtime: An exception has been thrown during the rendering of a template ("DateTime::__construct(): Failed to parse time string (Mi Jan 09 11:35:21 CET 2013) at position 0 (M): The timezone could not be found in the database") in "BCCResqueBundle:Default:index.html.twig" at line 101

When trying:

php -r '$date = new DateTime("Mi Jan 09 11:35:21 CET 2013");'

you get the same error.

Worker not processing queues or showing as active

Just installed this bundle into my project as I want to delegate the send of emails to a background process and Resque seems to be the best option.

I setup pretty much everything as stated in the documentation and I can access the BCC Resque UI with no problems. I have defined my job and also when I post something new into the queue I can see the items in the UI, I can click on them and see the args being passed. Everything seems to work as expected...

Now, I started a new worker with the following command:

php app/console bcc:resque:worker-start "*" --foreground

The worker is outputting this to the screen:

*** Starting worker winterfell:8186:*
*** Pruning dead worker: winterfell:8141:*
*** Sleeping for 5
*** Sleeping for 5
*** Sleeping for 5

However, none of the pending jobs in the queues are being processed and the BCC Resque UI still informs that there are no active workers, the table shows "empty...".

Any ideas what am I be missing? I double checked everything but can't see any difference between the documentation and what I did in my project.

Regards.

Database parameter is ignored

i'm getting issues with the change introduced in #14 and i believe this is because

  • BCC does store the jobs in the database defined in the bcc config,
  • but resque ignores it when calling bcc:resque:worker-start.

Also there should be a way to control verbosity of the command through command options

prefix configuration not working

You use the PREFIX environment variable, but you require chrisboulton/php-resque 1.2, and support for the PREFIX environment variable was added post-1.2.

You also require specifically chrisboulton/php-resque 1.2, so it’s not possible to install chrisboulton/php-resque dev-master.

Recurring Jobs

Hi,

I've built on top of this bundle: https://github.com/usemarkup/JobQueueBundle
I was wondering if any of the features I've added would be better placed directly into this bundle.

Recurring Jobs

What I've added is a mechanism for adding console command jobs (executed within a job using the process component) via a recurring configuration file that is similar to the crontab (using cron syntax).

    - command: your:console:command --and --any --options and arguments
      schedule: 1-59/2 * * * *
      queue: name-of-a-valid-queue

Reasons for this:

  • Ability to maintain scheduling of jobs via version control, and throughout environments without having to edit a crontab across deployment environments. Using a single process for all async jobs (including recurring jobs) allows for a common logging/error handling strategy.
  • We tend to develop on the command line, writing console jobs for most activities first. While often these commands are just wrappers calling lower level services - it is useful to be able to schedule these jobs on a recurring basis.
  • If this functionality is useful it could/should be extended to execute services that implement the command pattern (i.e have an 'execute' method), rather than having to use the console component via the process component.

Queue Configuration

I've added stricter queue configuration, meaning that queues need to be defined in application configuration (ensuring jobs added in code have a defined way of being processed). Additionally this configuration can be read by a capistrano task which is able to automatically generate the supervisord configuration file based on the queues defined (currently automatically creates a single worker per queue, but this could be further configured via the config file).

Admin Interface

I've performed a minor refactoring here to support our own stack, I'd be happy to pull this out altogether and move into my own app/ folder

Composer installs outdated package

It seems, that composer not crawled this repository for like four months. I don't know if this is a problem with Packagist, issue with composer.json file or some other misconfiguration.

For some reason, installing this bundle via composer downloads 79dbb7e as newest.
Packagist also confirms, that dev-master points to that commit.

I've spent like three or four hours tracing and patching what was already reported, fixed and merged ;-)

Job fails to get container if the queue is created from different host and has different kernel root dir.

I have separate hosts, one that creates the queue, and other that processes the worker and job.
When each server has different project root directories, it fails to get the container in ContainerAwareJob class.

I've found out why, but can't get this to work unless I hard code the root_dir in my project that create's the worker (which I don't like to do). Is there any suggestions to fix this??

related codes below

  • the Resque class calles the following method and adds kernelOptions (of the server creating queue) to $args before sending it to redis (which is listening on different host).
// ContainerAwareJob.php
public function setKernelOptions(array $kernelOptions)
{
    $this->args = \array_merge($this->args, $kernelOptions);
}
  • the ContainerAwareJob class fetches the kernelOption info from redis when running the job and fails to create the container, since app root is not the same as the queueing server.
// ContainerAwareJob.php
protected function createKernel()
{
    /**/
     $finder->name('*Kernel.php')->depth(0)->in($this->args['kernel.root_dir']);
    /**/
}

Array to String conversion

Hi,

I am not 100% sure but I think this issue already surfaced.

Within my test cases I am getting the Error: "Array to string conversion" in vendor/bcc/resque-bundle/BCC/ResqueBundle/Resque.php on line 89.

The odd thing is that if I debug the code and add watches for every piece of 89 in my debugger, everything is working as expected. Just not the actual execution.

Has anybody experienced issues in there?

Controlling workers with supervisord

I'm still having issues trying to manage these workers with supervisor. I tried both configurations:

[program:acme.com.resqueworker]
command=php app/console --env=dev bcc:resque:worker-start '*' --foreground
directory=/var/www/acme.com
user=www-data
autostart=true
autorestart=true

and...

[program:acme.com.resqueworker]
command = /usr/bin/php /var/www/acme.com/vendor/bcc/resque-bundle/BCC/ResqueBundle/bin/resque
user = myusername
environment = APP_INCLUDE='/var/www/acme.com/vendor/autoload.php',VERBOSE='1',QUEUE='*'

After I start the service (supervisorctl start acme.com.resqueworker) I can see these processes running:

www-data  4917     1  0 09:46 ?        00:00:00 sh -c php  /var/www/acme.com/app/../vendor/chrisboulton/php-resque/resque.php
www-data  4918  4917  0 09:46 ?        00:00:00 php /var/www/acme.com/app/../vendor/chrisboulton/php-resque/resque.php

Now, when I try to manually shutdown the service I see the following:

root@harrenhal:/etc/supervisor/conf.d# supervisorctl stop acme.com.resqueworker
acme.com.resqueworker: stopped
root@harrenhal:/etc/supervisor/conf.d# supervisorctl stop acme.com.resqueworker
acme.com.resqueworker: ERROR (not running)

I assume that now the worker is not running anymore as the first command notifies a successful stop and the second one says that it's not running anymore... But if I check the processes again I can still see them running:

www-data  4917     1  0 09:46 ?        00:00:00 sh -c php  /var/www/acme.com/app/../vendor/chrisboulton/php-resque/resque.php
www-data  4918  4917  0 09:46 ?        00:00:00 php /var/www/acme.com/app/../vendor/chrisboulton/php-resque/resque.php

So it appears supervisor can start these background processes but for some reason it can't stop them.

Any ideas? If anyone else using supervisor and working ok?

Regards

Workers and supervisord

I'm trying to add the workers to be started and monitored by supervisord. I have tried what is recommended by the documentation:

[program:acme_phpresque_scheduledworker]
command = /usr/bin/php /var/www/acme.com/vendor/chrisboulton/php-resque-scheduler/resque-scheduler.php
environment = APP_INCLUDE='/var/www/acme.com/vendor/autoload.php',VERBOSE='1',RESQUE_PHP='/var/www/acme.com/vendor/chrisboulton/php-resque/lib/Resque.php'
user = www-data
autostart=true
autorestart=true
stderr_logfile=/var/www/acme.com/app/logs/resque-scheduledworker.error.log
stdout_logfile=/var/www/acme.com/app/logs/resque-scheduledworker.out.log

And I have even tried using app/console directly (this is how I start other processes in my application):

[program:acme_phpresque_scheduledworker]
command = /usr/bin/php app/console --env=prod bcc:resque:scheduledworker-start --foreground
directory=/var/www/acme.com
user = www-data
autostart=true
autorestart=true
stderr_logfile=/var/www/acme.com/app/logs/resque-scheduledworker.error.log
stdout_logfile=/var/www/acme.com/app/logs/resque-scheduledworker.out.log

However, with both configurations supervisor outputs the following:

acme_phpresque_scheduledworker: ERROR (abnormal termination)

Looking at supervisor logs I can see the following:

2013-11-26 13:30:22,135 INFO spawned: 'acme_phpresque_scheduledworker' with pid 30739
2013-11-26 13:30:22,663 INFO exited: acme_phpresque_scheduledworker (exit status 0; not expected)
2013-11-26 13:30:23,668 INFO spawned: 'acme_phpresque_scheduledworker' with pid 30744
2013-11-26 13:30:24,192 INFO exited: acme_phpresque_scheduledworker (exit status 1; not expected)
2013-11-26 13:30:26,198 INFO spawned: 'acme_phpresque_scheduledworker' with pid 30751
2013-11-26 13:30:26,695 INFO exited: acme_phpresque_scheduledworker (exit status 1; not expected)
2013-11-26 13:30:29,702 INFO spawned: 'acme_phpresque_scheduledworker' with pid 30756
2013-11-26 13:30:30,199 INFO exited: acme_phpresque_scheduledworker (exit status 1; not expected)
2013-11-26 13:30:31,201 INFO gave up: acme_phpresque_scheduledworker entered FATAL state, too many start retries too quickly

I tried to add the option autorestart=unexpected to supervisor but with no luck. Is anyone starting/monitoring your resque workers with supervisor? Is it working? How did you setup the supervisor .conf file?

Regards and thanks!

versioning

what do we do about versioning ?

as pointed out by @lightglitch in issue #63 we already have rather large changes in the master branch compared to 1.1.7

among these are:

so i guess my question is, do we create a separate branch based on 1.1.7 for issues we want to have in 1.1.8 - or do we discontinue the 1.1 brach and go for a new 1.2.0 release with the changes we have in master now.

any comments or thoughts on this ?

How to know the reason for failed job ?

Hi, thanks for the awesome bundle.
I need to know the reason and the log of the job. is it possible currently ?
if not how do I proceed to manually debug it ?

Regards

Job returning value for auto_retry?

I set the auto_retry for my jobs and although the job is finishing OK the autoretry seems to be processing the job over and over. Is there any specific value that I should return from my job for the resque worker to know that the job finished successfully?

I set the auto_retry to 5min, 10min, and 30min and I can see the jobs being rescheduled even though it completes.

Any ideas?

Installation via Composer does not work when following README instructions

Hello,
I updated my composer.json according to README instructions:

{
    "name": "symfony/framework-standard-edition",
    "description": "The \"Symfony Standard Edition\" distribution",
    "autoload": {
        "psr-0": { "": "src/" }
    },
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "2.2.*",
        "doctrine/orm": "~2.2,>=2.2.3",
        "doctrine/doctrine-bundle": "1.2.*",
        "twig/extensions": "1.0.*",
        "symfony/assetic-bundle": "2.1.*",
        "symfony/swiftmailer-bundle": "2.2.*",
        "symfony/monolog-bundle": "2.2.*",
        "sensio/distribution-bundle": "2.2.*",
        "sensio/framework-extra-bundle": "2.2.*",
        "sensio/generator-bundle": "2.2.*",
        "jms/security-extra-bundle": "1.4.*",
        "jms/di-extra-bundle": "1.3.*",
        "bcc/resque-bundle": "dev-master"
    },
    "repositories": [
        {
            "type": "git",
            "url": "https://github.com/chrisboulton/php-resque-scheduler"
        }
    ],
    "scripts": {
        "post-install-cmd": [
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
        ],
        "post-update-cmd": [
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
        ]
    },
    "config": {
        "bin-dir": "bin"
    },
    "minimum-stability": "alpha",
    "extra": {
        "symfony-app-dir": "app",
        "symfony-web-dir": "web",
        "branch-alias": {
            "dev-master": "2.2-dev"
        }
    }
}

The composer update command prints this:

Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for bcc/resque-bundle dev-master -> satisfiable by bcc/resque-bundle dev-master.
    - bcc/resque-bundle dev-master requires chrisboulton/php-resque dev-master -> no matching package found.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.

Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

prefix config option does not work correctly

Without using the prefix option in the config everything works fine. But after using the option it immediately does not find the running workers any more although the job is running.

user@vagrant-ubuntu-raring-64:~/current$ ./app/api/console bcc:resque:worker-start queue
Starting worker nohup php  /home/dev/app/api/../../vendor/chrisboulton/php-resque/resque.php > /home/dev/app/api/logs/resque.log 2>&1 & echo $!
Worker started vagrant-ubuntu-raring-64:5233:queue
user@vagrant-ubuntu-raring-64:~/current$ ./app/api/console bcc:resque:worker-stop
There is no running worker.

Also queued jobs for this queue are not picked up any more. Maybe it is related to #50

Used version is 1.1.7.

Tagged versions

Would be nice to see tagged version releases for this bundle. That way Packagist will index it (if you setup the Github Hook) and we can depend on a specific version.

To start, you can tag the latest commit like "v1.0.0".

Worker child process hangs and parent process waiting indefinitely

This might just be an issue with php-resque.

I am trying to run a worker in my box at amazon. Everytime I start a worker, it finds a job from the queue, forks and hangs.

Here is the log from resque.log

*** Starting worker ip-XXX-31-2-XXX:12563:default
*** Registered signals
*** Pruning dead worker: ip-XXX-31-2-XXX:11416:default
*** Checking default
*** Found job on default
*** got (Job{default} | ID: 1b1c11cf4cec190e7bbe3a33d8a532f5 | MyBundle\Jobs\GcmJob | [{"gcmId":"XUXvAN1PDgd8SLI57tb5X7lZewOM4qLNZFKmFg4Dq8H7i3JukS7JOeKbWnhs58s5tlvYwK_hYmEel9yRBkmdTSb5EB6mDlF18r01DX2YnFFJ853_TUSIeAc","kernel.root_dir":"\/var\/www\/20140221210655\/app","kernel.debug":false,"kernel.environment":"prod"}])
*** Forked 12567 at 2014-03-02 17:18:10
*** Processing default since 2014-03-02 17:18:10

There is nothing beyond this point.
When I ran strace against both parent and child processes:

In parent processing is waiting in a wait4() call

In the child process, I get this:

rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0

I dont see any other syscall.
This was working on an inhouse box running php 5.4

At amazon the box is running on php 5.5.7

Use BLPOP by default

I raised the question at chrisboulton/php-resque#150 if we should enable BLOCKING mode by default.

I think it will take some time to get it approved so why not set BLOCKING=true here?

BLPOP is much faster than the default 5 second polling method.

Why creating a UI if php-resque let us use the Ruby Resque UI ?

Hey, I'm wondering why do you work on a UI if the original Ruby Resque version web user interface is compatible with the php-resque library?
I would like to use this bundle in my project but I would prefere to use the ruby based UI. Is there any known issue related to that?
Thanks

Container Aware Job error

I'm just making my job class extending ContainerAwareJob as shown in the readme section. I'm getting the following error.
Undefined index: kernel.root_dir in /home/shwetanka/practo/pvr/vendor/bundles/BCC/ResqueBundle/ContainerAwareJob.php line 40

I'm using Symfony2.0.x. Is it because of this or some other issue?

Wrong parameter count

I'm just having a weird error message in my production server coming from the resque worker, has anyone seen anything like it before?

[info] [18:28:12 2014-01-03] Starting blocking with timeout of 5
PHP Warning:  Wrong parameter count for Redis::blPop() in /var/www/acme.com/vendor/colinmollenhour/credis/Client.php on line 608
[info] [18:28:12 2014-01-03] Starting blocking with timeout of 5
PHP Warning:  Wrong parameter count for Redis::blPop() in /var/www/acme.com/vendor/colinmollenhour/credis/Client.php on line 608

I'm not getting these messages in my development box by the way.

Regards

Executing a Job directly without PHP Resque

I am using Job classes to lift out heavy duty work and execute asynchronously. But there are some cases where I want to run the Job synchronously (either in a web request or another Symfony2 Command).

Is there a way I can dispatch a Job Request? By some way initializing this class or so.. and executing the run command with necessary $args.

What would be the cleanest way to achieve this goal?

My aim here is to increase code re-usability without creating a third class which is used by bot the Job and my other requirements.

p.s: My jobs are container aware.

Error in production server in vendor/chrisboulton/php-resque/lib/Resque/Worker.php line 455

Hello,

I have this error in production server:

ContextErrorException: Notice: Undefined variable: cmdOutput in /current/vendor/chrisboulton/php-resque/lib/Resque/Worker.php line 455

This is my composer.json:

    "chrisboulton/php-resque": "dev-master",
    "chrisboulton/php-resque-scheduler": "dev-master",
    "bcc/resque-bundle": "dev-master#87b0e8b",

Someone known what happen?

Thanks

Regards

Workers are not using database config parameter

When starting a worker on mac, it does not handles job queue and I cannot see on my /resque admin side.

jeremy@76 Sites/acme (master !%) » ./app/console bcc:resque:worker-start -f --verbose default
Starting worker php /Volumes/Storage/Sites/acme/app/../vendor/chrisboulton/php-resque/resque.php
*
* Starting worker mac.local:97477:*
*** Registered signals
*** Sleeping for 5
*** Sleeping for 5
*** Sleeping for 5

Screenshot on 2013-03-29 at 19 03 12

bcc resque pruneWorker is killing performances of my Symofny2 application

Disclamer : I love this bundle, we used it in my company for many different things and we rely on it heavily.

That being said, you must remove the "" configuration that calls the pruneDeadWorkers method when the service is called. It is killing performances. My benchmarks clearly show a 300% improvement when I disable it. The thing is that this service is instantiated by a dependency from another service that we use everywhere in our app so even when you request the homepage, we instantiate the service and therefore do a "pruneDeadWorker". I have spent weeks on profiling my application to understand where was this overhead and finally found it today.
Please do something.

The solution I found is to extend the Resque class, override this function and change app/config/config.yml to tell to Resque to use this new class. Here are my code snippet :

#app/config/config.yml
bcc_resque:
    class: Producteev\WorkerBundle\Resque\ResqueCustom  # the resque class if different from default

#Producteev/WorkerBundle/Resque/ResqueCustom.php

<?php

namespace Producteev\WorkerBundle\Resque;

use BCC\ResqueBundle\Resque;

class ResqueCustom extends Resque
{
    /**
    * Override the function that is called at the @bcc_resque.resque initialization so it does nothing.
    * This function is ressource comsuming, the design is wrong and the worker cleaning shouldn't happen
    * at that time.
    */
    public function pruneDeadWorkers()
    {

    }
}

Thanks for your work, I really love it.

Twig_Error_Runtime: An exception has been thrown during the rendering of a template ("") in BCCResqueBundle:Default:index.html.twig

When my workers are running, the GUI has exceptions within it.

Pasting stack trace below:

[1] Twig_Error_Runtime: An exception has been thrown during the rendering of a template ("") in "BCCResqueBundle:Default:index.html.twig" at line 88.
    at n/a
        in app/cache/dev/classes.php line 6197

    at Twig_Template->displayBlock('body', array('resque' => object(Resque), 'assetic' => array('debug' => true, 'vars' => object(ValueContainer), 'use_controller' => true), 'app' => object(GlobalVariables)), array('body' => array(object(__TwigTemplate_45dfde19303cbf6daa42e80d0cb3d73c01c98b9ababb5ca80057742e071759c0), 'block_body')))
        in app/cache/dev/twig/da/73/3151cc3794f0e6c5130f6386dfcc3944428a310e5abe20e3723628748771.php line 39

    at __TwigTemplate_da733151cc3794f0e6c5130f6386dfcc3944428a310e5abe20e3723628748771->doDisplay(array('resque' => object(Resque), 'assetic' => array('debug' => true, 'vars' => object(ValueContainer), 'use_controller' => true), 'app' => object(GlobalVariables)), array('body' => array(object(__TwigTemplate_45dfde19303cbf6daa42e80d0cb3d73c01c98b9ababb5ca80057742e071759c0), 'block_body')))
        in app/cache/dev/classes.php line 6248

    at Twig_Template->displayWithErrorHandling(array('resque' => object(Resque), 'assetic' => array('debug' => true, 'vars' => object(ValueContainer), 'use_controller' => true), 'app' => object(GlobalVariables)), array('body' => array(object(__TwigTemplate_45dfde19303cbf6daa42e80d0cb3d73c01c98b9ababb5ca80057742e071759c0), 'block_body')))
        in app/cache/dev/classes.php line 6229

    at Twig_Template->display(array('resque' => object(Resque), 'assetic' => array('debug' => true, 'vars' => object(ValueContainer), 'use_controller' => true), 'app' => object(GlobalVariables)), array('body' => array(object(__TwigTemplate_45dfde19303cbf6daa42e80d0cb3d73c01c98b9ababb5ca80057742e071759c0), 'block_body')))
        in app/cache/dev/twig/45/df/de19303cbf6daa42e80d0cb3d73c01c98b9ababb5ca80057742e071759c0.php line 24

    at __TwigTemplate_45dfde19303cbf6daa42e80d0cb3d73c01c98b9ababb5ca80057742e071759c0->doDisplay(array('resque' => object(Resque), 'assetic' => array('debug' => true, 'vars' => object(ValueContainer), 'use_controller' => true), 'app' => object(GlobalVariables)), array())
        in app/cache/dev/classes.php line 6248

    at Twig_Template->displayWithErrorHandling(array('resque' => object(Resque), 'assetic' => array('debug' => true, 'vars' => object(ValueContainer), 'use_controller' => true), 'app' => object(GlobalVariables)), array())
        in app/cache/dev/classes.php line 6229

    at Twig_Template->display(array('resque' => object(Resque)))
        in app/cache/dev/classes.php line 6236

    at Twig_Template->render(array('resque' => object(Resque)))
        in vendor/symfony/symfony/src/Symfony/Bridge/Twig/TwigEngine.php line 50

    at Symfony\Bridge\Twig\TwigEngine->render('BCCResqueBundle:Default:index.html.twig', array('resque' => object(Resque)))
        in vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/TwigEngine.php line 74

    at Symfony\Bundle\TwigBundle\TwigEngine->render('BCCResqueBundle:Default:index.html.twig', array('resque' => object(Resque)))
        in vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Debug/TimedTwigEngine.php line 52

    at Symfony\Bundle\TwigBundle\Debug\TimedTwigEngine->render('BCCResqueBundle:Default:index.html.twig', array('resque' => object(Resque)))
        in vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/TwigEngine.php line 99

    at Symfony\Bundle\TwigBundle\TwigEngine->renderResponse('BCCResqueBundle:Default:index.html.twig', array('resque' => object(Resque)), null)
        in vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php line 106

    at Symfony\Bundle\FrameworkBundle\Controller\Controller->render('BCCResqueBundle:Default:index.html.twig', array('resque' => object(Resque)))
        in vendor/bcc/resque-bundle/BCC/ResqueBundle/Controller/DefaultController.php line 18

    at BCC\ResqueBundle\Controller\DefaultController->indexAction()
        in  line 

    at call_user_func_array(array(object(DefaultController), 'indexAction'), array())
        in app/bootstrap.php.cache line 2911

    at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), '1')
        in app/bootstrap.php.cache line 2883

    at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), '1', true)
        in app/bootstrap.php.cache line 3022

    at Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel->handle(object(Request), '1', true)
        in app/bootstrap.php.cache line 2303

    at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
        in web/app_dev.php line 26

[2] Symfony\Component\Debug\Exception\DummyException: 
    at n/a
        in vendor/symfony/symfony/src/Symfony/Component/Debug/ErrorHandler.php line 174

    at Symfony\Component\Debug\ErrorHandler->handle('8', 'Array to string conversion', 'app/cache/dev/twig/45/df/de19303cbf6daa42e80d0cb3d73c01c98b9ababb5ca80057742e071759c0.php', '190', array('context' => array('resque' => object(Resque), 'assetic' => array('debug' => true, 'vars' => object(ValueContainer), 'use_controller' => true), 'app' => object(GlobalVariables), 'worker' => object(Worker), 'job' => object(FetchAndUpsert), '_parent' => array('resque' => object(Resque), 'assetic' => array('debug' => true, 'vars' => object(ValueContainer), 'use_controller' => true), 'app' => object(GlobalVariables), 'worker' => object(Worker), 'job' => object(FetchAndUpsert), '_parent' => array('resque' => object(Resque), 'assetic' => array('debug' => true, 'vars' => object(ValueContainer), 'use_controller' => true), 'app' => object(GlobalVariables)), '_seq' => array(object(Worker), object(Worker), object(Worker), object(Worker), object(Worker)), '_iterated' => true, '_key' => '1'), '_seq' => array('storeId' => '51f28fb6a875a19134000004', 'categoryId' => '20', 'kernel.root_dir' => 'app', 'kernel.debug' => true, 'kernel.environment' => 'dev', 'bcc_resque.retry_strategy' => array('60', '600')), '_iterated' => true, '_key' => '1', 'argvalue' => array('60', '600'), 'argname' => 'bcc_resque.retry_strategy'), 'blocks' => array(), '_parent' => array('resque' => object(Resque), 'assetic' => array('debug' => true, 'vars' => object(ValueContainer), 'use_controller' => true), 'app' => object(GlobalVariables), 'worker' => object(Worker), '_parent' => array('resque' => object(Resque), 'assetic' => array('debug' => true, 'vars' => object(ValueContainer), 'use_controller' => true), 'app' => object(GlobalVariables)), '_seq' => array(object(Worker), object(Worker), object(Worker), object(Worker), object(Worker)), '_iterated' => true, '_key' => '1', 'job' => null)))
        in app/cache/dev/twig/45/df/de19303cbf6daa42e80d0cb3d73c01c98b9ababb5ca80057742e071759c0.php line 190

    at __TwigTemplate_45dfde19303cbf6daa42e80d0cb3d73c01c98b9ababb5ca80057742e071759c0->block_body(array('resque' => object(Resque), 'assetic' => array('debug' => true, 'vars' => object(ValueContainer), 'use_controller' => true), 'app' => object(GlobalVariables)), array())
        in app/cache/dev/classes.php line 6193

    at Twig_Template->displayBlock('body', array('resque' => object(Resque), 'assetic' => array('debug' => true, 'vars' => object(ValueContainer), 'use_controller' => true), 'app' => object(GlobalVariables)), array('body' => array(object(__TwigTemplate_45dfde19303cbf6daa42e80d0cb3d73c01c98b9ababb5ca80057742e071759c0), 'block_body')))
        in app/cache/dev/twig/da/73/3151cc3794f0e6c5130f6386dfcc3944428a310e5abe20e3723628748771.php line 39

    at __TwigTemplate_da733151cc3794f0e6c5130f6386dfcc3944428a310e5abe20e3723628748771->doDisplay(array('resque' => object(Resque), 'assetic' => array('debug' => true, 'vars' => object(ValueContainer), 'use_controller' => true), 'app' => object(GlobalVariables)), array('body' => array(object(__TwigTemplate_45dfde19303cbf6daa42e80d0cb3d73c01c98b9ababb5ca80057742e071759c0), 'block_body')))
        in app/cache/dev/classes.php line 6248

    at Twig_Template->displayWithErrorHandling(array('resque' => object(Resque), 'assetic' => array('debug' => true, 'vars' => object(ValueContainer), 'use_controller' => true), 'app' => object(GlobalVariables)), array('body' => array(object(__TwigTemplate_45dfde19303cbf6daa42e80d0cb3d73c01c98b9ababb5ca80057742e071759c0), 'block_body')))
        in app/cache/dev/classes.php line 6229

    at Twig_Template->display(array('resque' => object(Resque), 'assetic' => array('debug' => true, 'vars' => object(ValueContainer), 'use_controller' => true), 'app' => object(GlobalVariables)), array('body' => array(object(__TwigTemplate_45dfde19303cbf6daa42e80d0cb3d73c01c98b9ababb5ca80057742e071759c0), 'block_body')))
        in app/cache/dev/twig/45/df/de19303cbf6daa42e80d0cb3d73c01c98b9ababb5ca80057742e071759c0.php line 24

    at __TwigTemplate_45dfde19303cbf6daa42e80d0cb3d73c01c98b9ababb5ca80057742e071759c0->doDisplay(array('resque' => object(Resque), 'assetic' => array('debug' => true, 'vars' => object(ValueContainer), 'use_controller' => true), 'app' => object(GlobalVariables)), array())
        in app/cache/dev/classes.php line 6248

    at Twig_Template->displayWithErrorHandling(array('resque' => object(Resque), 'assetic' => array('debug' => true, 'vars' => object(ValueContainer), 'use_controller' => true), 'app' => object(GlobalVariables)), array())
        in app/cache/dev/classes.php line 6229

    at Twig_Template->display(array('resque' => object(Resque)))
        in app/cache/dev/classes.php line 6236

    at Twig_Template->render(array('resque' => object(Resque)))
        in vendor/symfony/symfony/src/Symfony/Bridge/Twig/TwigEngine.php line 50

    at Symfony\Bridge\Twig\TwigEngine->render('BCCResqueBundle:Default:index.html.twig', array('resque' => object(Resque)))
        in vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/TwigEngine.php line 74

    at Symfony\Bundle\TwigBundle\TwigEngine->render('BCCResqueBundle:Default:index.html.twig', array('resque' => object(Resque)))
        in vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/Debug/TimedTwigEngine.php line 52

    at Symfony\Bundle\TwigBundle\Debug\TimedTwigEngine->render('BCCResqueBundle:Default:index.html.twig', array('resque' => object(Resque)))
        in vendor/symfony/symfony/src/Symfony/Bundle/TwigBundle/TwigEngine.php line 99

    at Symfony\Bundle\TwigBundle\TwigEngine->renderResponse('BCCResqueBundle:Default:index.html.twig', array('resque' => object(Resque)), null)
        in vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php line 106

    at Symfony\Bundle\FrameworkBundle\Controller\Controller->render('BCCResqueBundle:Default:index.html.twig', array('resque' => object(Resque)))
        in vendor/bcc/resque-bundle/BCC/ResqueBundle/Controller/DefaultController.php line 18

    at BCC\ResqueBundle\Controller\DefaultController->indexAction()
        in  line 

    at call_user_func_array(array(object(DefaultController), 'indexAction'), array())
        in app/bootstrap.php.cache line 2911

    at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), '1')
        in app/bootstrap.php.cache line 2883

    at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), '1', true)
        in app/bootstrap.php.cache line 3022

    at Symfony\Component\HttpKernel\DependencyInjection\ContainerAwareHttpKernel->handle(object(Request), '1', true)
        in app/bootstrap.php.cache line 2303

    at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
        in web/app_dev.php line 26

Symfony 2.3

Please update composer.json so that it allows symfony/framework-bundle 2.3.* + create new tag

Running workers on a seperarte machine

Hi,
Thanks for this bundle. I want to know how can i run the workers on a different machine. I use this bundle to convert the videos to mp4 format in my web app. Currently all the workers run on a single machine where the web app is. I want to run these worker processes on a different machine thus decoupling the complexity and reducing the load of my server.

Thanks,
Seshachalam

Event listener support for Resque's Event/Hook System

If a job fails due to an exception, I want to log an entry using Monolog. How am I supposed to listen to job failure events with this bundle?

The PHP Resque library supports an Event/Hook System.. what is the recommended approach while using this bundle?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.