In RPQueue for Python (
https://github.com/josiahcarlson/rpqueue/), delayed, scheduled, and periodic task execution is one of the central design ideas.
What we do there is to use a ZSET for the scheduling of items, where a Lua script moves (or copies and reschedules) scheduled items from the ZSET schedule to LIST-based FIFO queues. All workers use BLPOP calls to find items to execute from the queues, with one thread on every task runner daemon running the Lua script to handle schedule updates. I will typically run a single daemon on a server, which spawns as many worker processes as there are cores in the machine, and which spawns a user-configurable number of threads per process - for all of this, there is 1 thread handling schedule updates.
There should already be a queue library that offers this support for Java, though I don't follow the Java dev community, so I don't know where to point you.
- Josiah