Live data from Hacker News

Announcing DJJob, a PHP port of delayed_job

seatgeek.com

1–10 of 15 posts

Re: Announcing DJJob, a PHP port of delayed_job

#6
In your example, does the call:

$worker = new DJWorker($options); $worker->start();

Actually: 1. block until all jobs stored in the database have been completed 2. simply run a single job and return 3. return immediately and run all the jobs on a separate thread in the background

I'm wondering where in a web application would be the best place to call $worker->start()?

Re: Announcing DJJob, a PHP port of delayed_job

#7
post #3

Also the php PECL gearman driver ( http://pecl.php.net/package/gearman ) works well with the C-based gearmand server ( http://gearman.org/ ). We do some asynchronous image processing with PHP gearman workers, and it's been a very stable solution for us.

Gearman is especially handy if you expose your application to it. I've got a wrapper that allows the app to push any function call out to the workers for async handling. So your image processing (or whatever heavy/blocking task) can be dispatched from within your standard libraries without having to maintain a separate set of code.

Re: Announcing DJJob, a PHP port of delayed_job

#8
post #3

Also the php PECL gearman driver ( http://pecl.php.net/package/gearman ) works well with the C-based gearmand server ( http://gearman.org/ ). We do some asynchronous image processing with PHP gearman workers, and it's been a very stable solution for us.

And the post here sounds very NIH for not even mentioning Gearman in its survey of options.

Re: Announcing DJJob, a PHP port of delayed_job

#9
post #6

In your example, does the call: $worker = new DJWorker($options); $worker->start(); Actually: 1. block until all jobs stored in the database have been completed 2. simply run a single job and return 3. return immediately and run all the jobs on a separate thread in the background I'm wondering where in a web application would be the best place to call $worker->start()?

I think the point is to run the worker outside of a web request and using a cron job

Re: Announcing DJJob, a PHP port of delayed_job

#10
I'm the author of Delayed Job. The popularity of it really surprises me to no end, and always brings a smile to my face. DJ took about 15 minutes to code up originally and is a product of one of those software rage moments ("why don't people queue like this??!").

I put it on GitHub because Jeremy Kemper really wanted to have a look at it. I thought the idea behind it was so naive that it would have occurred to everyone who ever needed a queue and had discarded the approach for some reason.

Little did I know that it was a fairly novel approach and that it would become one of my most popular libraries, right after ActiveMerchant and Liquid.

Thank you for the PHP port!

Post reply on HN