super3 / IRC-Bot

A very little basic IRCBot that will get improved over the next time.
http://www.wildphp.com
102 stars 47 forks source link

Scheduler #55

Open NanoSector opened 9 years ago

NanoSector commented 9 years ago

Perhaps it would be nice if functions could be executed on a certain interval. E.g. get the latest Github commits every hour and display them. Or clean up logs every day.

The principle would be the same as the Listener structure, except it's triggered in a different way.

I don't have ideas how a scheduler in PHP would work, so if this is agreed on that's something to work out.

TimTims commented 9 years ago

I'll take a look when I have some time, shouldn't be too hard

oliveratgithub commented 9 years ago

+1 I could really need something like this for my implementation of the IRC-Bot ;)

NanoSector commented 9 years ago

Okay. You can just hook into the main loop. We could use something similar to Listeners, the new log system makes use of this.

Do the modules themselves need to do the actual interval work, or can we make the bot handle the intervals themselves?