vibe-d / vibe.d

Official vibe.d development
MIT License
1.15k stars 284 forks source link

Add a higher-level setPersistentTimer #1200

Open etcimon opened 9 years ago

etcimon commented 9 years ago

The goal of a persistent timer would be to survive crashes or application restarts, the only use I can think of right now is runtime-initialized cronjobs and services for tasks.

It would require:

Since this is probably independent of the HTTP module, I guess it would belong in vibe.core directly.

s-ludwig commented 9 years ago

I actually have some code lying around for that, but never could really decide where to put it inside vibe.d: https://github.com/D-Programming-Language/dub-registry/blob/master/source/dubregistry/scheduler.d Maybe I should just put it into a little separate package first...

Ironically, it's still unused for the DUB registry itself.

etcimon commented 9 years ago

Cool, all it's missing is some event parameters in json.

Geod24 commented 9 years ago

Just a note: Don't put it in core please :)

etcimon commented 9 years ago

Maybe in vibe.db.redis.timers

s-ludwig commented 9 years ago

Just a note: Don't put it in core please :)

I won't do that, so much is certain (even though it would work out in terms of dependencies, but it's just a too high level concept for core). I'd also like to keep it DB independent. Probably it'll just be a separate package, because currently vibe.d doesn't have a high-level utility module and it would be nice to keep it that way.