danryan/hal — pull request #40 by djosephsen (2014-12-12 22:04:11+00:00)
Title: implement chores (sheduled tasks)

Curious what you think about this..

There are several things I want my various bots to do on a daily or hourly basis (like check the status of RSS feeds). It's possible now to create a handler with a pattern of "", and use it to setup and manage timers inside my handler. I think the attached approach is more elegant. It gives the user the ability to setup a special kind of handler called a 'chore'. The user specifies a chore type, which includes a crontab-style schedule, and the bot figures out the duration to the next date/time that meets the schedule, and fires a goroutine to launch the user-specified run() function attached to the chore when the timer expires. Some simple handlers are included to get the bot to list all registered chores as well as, start, and stop individual chores as needed.

![screen shot 2014-12-12 at 4 00 35 pm](https://cloud.githubusercontent.com/assets/1113505/5420199/67b54a0e-8218-11e4-83e3-8101e29669cd.png)