Jason Tackaberry wrote:
> On 2007-10-23 07:34, Duncan Webb wrote:
>> Does kaa.notifier.Timer have an 'at' function so that something can be
>> run at a specific interval? The recordserver runs its loop at the top of
>> the minute so a function like Timer(handler).at('*:00') would be very
>> useful. This could be extended to run every hour at 15 minutes past
>> using Timer(handler).at('*:15:00'). If you see what I mean.
>
> No, but interesting idea.
>
> dischi, what do you think?

Nice idea and very usefull for the freevo-tvdev in 2.0 which does this
manually. Also usefull for my new feed stuff.

But I'm not sure it fits into Timer, I'm worried that it will make the
Timer class too complicated inside. A timer like this uses
OneShotTimer all the time. So IMHO we should use a different
class. Name suggestions? CronTimer?

As for the API I'm thinking of at/schedule, remove and list.

| t = CronTimer(callback)
| t.at("*:15")
| t.at("*:20")
| t.list() => [ "*:15", "*:20" ]
| t.remove("*:15")
| t.list() => [ "*:20" ]

at could get a second parameter repeat, 0 meaning forever. Or we make
a OneShotCronTimer. I may also need a way to specify seconds when a
recording schould start 10 seconds earlier:

| t.at("*:15") ==> every hour at x:15:00 minutes
| t.at("*:14:50") ==> every hour at x:14:50 minutes
| t.at("10:15") ==> at 10:15
| t.at("10:14:50") ==> at 10:14:50


Comments?


Dischi

-- 
Atheism: A non-prophet organization.

Attachment: pgpRaZN9kIsPO.pgp
Description: PGP signature

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Freevo-devel mailing list
Freevo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to