Has anyone given delayed execution of a command a thought? i.e. running a command some time in the future?
I had few ideas around message queue implementation that could leverage that
What do you think are the challenges of implementing it?
Comment From: fhalde
One issue I can think of is its behaviour in a cluster environment
Comment From: AngusP
This might be a cool idea for a module, or perhaps something like Redis Gears. I'm not too sure how much sense it'd make in core Redis, given it's more of a code pattern than a datastructure per-se... You could also implement something like this in your application using keyspace notifications and keys with a TTL to trigger a task
Comment From: fhalde
@AngusP agreed on the 'code pattern than a datastructure' part ! let me have a look at redis modules
Comment From: fhalde
@AngusP let's say i were to take the approach of implementing it using redis module, then
- In my redis module initialization, i'd init an epoll instance ( or kqueue whatever it is based on the system) - or should I be using the one made by redis core itself?
- What happens when a module blocks? The whole redis system probably halts I guess - how would I overcome this? because if i were to use epoll, then somewhere in my module, i'll have to do an epoll_wait on some timerfd (the linux equivalent for creating timers
timerfd_create) - I assume redis module when executed (the command), runs atomically in isolation (i.e. no other command runs)
not really aware of redis internals!
Comment From: tzongw
Hey, I am doing some similar things, hope this project can help. redis-timer