Skip to content

polling now uses blpop, fixed (string) casts. #58

Closed
wants to merge 8 commits into from

4 participants

@ingoclaro

Hi, I changed the work polling to use blpop, with that you get job as soon as it's one available, and also you can monitor many keys at once.

  • Added support for php-redis if it's available.
  • Fixed some missing (string) casts.
@ingoclaro

on commit 21edc2f I fixed a bug: there was missing some (string) casts, resulting in that "Object" was stored on redis instead of the worker ID.

@ingoclaro ingoclaro closed this Jun 6, 2012
@ingoclaro ingoclaro reopened this Jun 6, 2012
@ruudk
ruudk commented Jul 26, 2012

@chrisboulton What's the status on this? We would really want to use PHP Resque but we want that realtime feeling that blpop gives. Could you merge this in?

@chrisboulton
Owner

I want to bring this down in to the next release - excited by these changes as well. The one thing it's missing (and I'm not sure how to handle yet) is some sort of test or two.

@ruudk
ruudk commented Jul 27, 2012

Maybe @ingoclaro can supply some unittests?

@jbrower
jbrower commented Dec 10, 2012

Any news on this or any way that I can help? I would love to have this functionality.

@ingoclaro

Hi all, I'm aware that I included too many changes in this pull request, sorry for that.
The thing is that I haven't time to add the tests you are requesting, I'm currently using this on production and works very well for me with 100+ workers per queue. I corrected some bugs regarding string assignments and also if you try to have more than 1 worker.

Note that I also changed the way to check for the queues, as now it uses blpop it can check all queues simultaneously and it must be done so if you want to process the jobs as soon as one is on the queue.

@jbrower
jbrower commented Dec 10, 2012

@chrisboulton what do you think it would take to get this implemented. It looks like quite a few changes have happened since the 4 months the pull request was made. If something like this could be implemented, that would resolve 2 issues/pull requests and would certainly make php-resque more responsive, especially when queues will occasionally be empty.

The code seems fairly solid, though I've not had a chance to test that myself.

@chrisboulton
Owner

Hi,

Looks like we're going to include this for BLPOP support: #63

I apologize for not giving this PR the time it deserved when it was raised. :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.