php-resque
php-resque copied to clipboard
Blocking configuration option
What are the pros and cons of using the blocking
option in the config.yml
? It's not documented anywhere and I couldn't figure out what the main functionality differences are. I'm currently using it with blocking turned on, but I was wondering what the difference might be.
If blocking is enabled it uses the redis BLPOP command https://redis.io/commands/blpop (instead of LPOP)
Yeah I understand that much, but what are the behavior differences in using each?
Alright - it did some more in depth reading, it looks like BLPOP is more efficient to immediately grab jobs as they come in because redis will return one as soon as its available, whereas LPOP will sleep and only get a job at the end of the interval when it loops again.
What I'm trying to get at with my question though, is why would someone choose to use non-blocking over blocking? To me there doesn't seem to be any benefits to that behaviour. Essentially I'm asking why it's even an option if blocking seems to just be straight-up better for a queue system?
Last week I found some interesting articles regarding Redis performance tuning where blocking vs non-blocking mode is explained in detail... I'll post the references here on monday.