Is there any possibility to make the zRangeByScore blocking?

I've implemented the AWS SQS-like queue equivalent with: zRangeByScore, zAdd, zRem, setex and `get. Unfortunately my workers needs to query Redis, e.g. each 100ms to get the results as soon as possible. This causes unnecessary stress to both application and Redis. Especially that I am running tens of queues. This solution doesn't scale. I would like to reduce time to retrieve item down to ~10ms and support hundreds of queues. This would case huge stress on both Redis and my application.

The zRangeByScore is the function used to retrieve the items that needs to be processed. If I manage to make it blocking, that would solve the problem.

Is there any possibility / way to introduce blocking zRangeByScore?

This Gist might be useful for anyone that wants to have SQS-like equivalent using Redis: https://gist.github.com/tomekit/676e93e67c0fe45d2d7f576bc0672542

EDIT: I think this was mentioned here: https://github.com/antirez/redis/issues/2801 however the original author closed the issue since he found a solution / implemented Laravel

Comment From: itamarhaber

Hello @tomekit

Have you considered using BZPOPMIN instead of polling?

Comment From: ghost

I also need the functionality of a blocking ZRANGEBYSCORE.

BZPOPMIN will not work as the score is a timestamp and the current min may not have occurred yet.. unless I could add a maximum value limit to BZPOPMIN of the current time.