Ruby: "do this task eventually"
Posted
by marienbad
on Stack Overflow
See other posts from Stack Overflow
or by marienbad
Published on 2010-04-05T22:22:35Z
Indexed on
2010/04/05
23:03 UTC
Read the original article
Hit count: 291
ruby
I hope this question is clear enough -- if not let me know :)
What API would I use when I want to write a procedure at runtime and then just run it eventually at low priority while continuing to do the important stuff right now?
Example: link checker
1. I write a blog post with links represented by Link objects. I publish the post.
2. Eventually (at very low priority) the system gets around to fetching the URL of each Link object to make sure it's not broken and indicates that in a property of the Link object.
3. When a user visits my blog post, the render code that turns Link objects into HTML knows whether the links have been checked.
I'm assuming there's a very general purpose API for doing this kind of "eventually/low priority" stuff.
© Stack Overflow or respective owner