Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delayed execution of a command #6066

Open
fhalde opened this issue May 2, 2019 · 5 comments
Open

Delayed execution of a command #6066

fhalde opened this issue May 2, 2019 · 5 comments

Comments

@fhalde
Copy link

fhalde commented May 2, 2019

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?

@fhalde
Copy link
Author

fhalde commented May 2, 2019

One issue I can think of is its behaviour in a cluster environment

@AngusP
Copy link
Contributor

AngusP commented May 3, 2019

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

@fhalde
Copy link
Author

fhalde commented May 6, 2019

@AngusP agreed on the 'code pattern than a datastructure' part ! let me have a look at redis modules

@fhalde
Copy link
Author

fhalde commented May 6, 2019

@AngusP let's say i were to take the approach of implementing it using redis module, then

  1. 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?
  2. 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)
  3. I assume redis module when executed (the command), runs atomically in isolation (i.e. no other command runs)

not really aware of redis internals!

@tzongw
Copy link
Contributor

tzongw commented Jun 29, 2022

Hey, I am doing some similar things, hope this project can help.
redis-timer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants