Taskit: a rails scheduler plugin
Sometimes, in a rails application, you want to be able to periodically run code outside the context of a web request. This might include code which tidies up old sessions, or other administrative tasks like generating invoices. This idea is especially pertinent for longer-running tasks, so that you don’t block a thread of your web server during execution.
Today, I finally got around to putting Taskit onto github. This is a rails plugin which allows you to do just that.
With Taskit, you can schedule tasks to run at various frequencies or times of day. To schedule tasks, all you need to do is add the relevant entries into a couple of database tables that this plugin creates. At the scheduled times, the specified method of the appropriate class will be called.
You will also need to set up a something to call the task runner periodically (such as a cron job), but this only needs to be set up once for each rails app and from then on you can administer all tasks through the database configuration – something I personally find much easier than fiddling around with cron.
That’s really all there is to Taskit: It’s very simple, but hopefully it will remove a little bit of pain from running these kinds of tasks, and let you get on with what’s really important – writing remarkable apps.
There’s more details on how to use Taskit in the readme file in github. If you’d like to contribute any enhancements, or if you have any comments, please get in touch.
I co-founded, built, and run




