Dirk Meyer wrote:
> 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

The seconds bit is exactly what I was thinking about, I would like the
recordserver to run every minute at 15 seconds to the minute.

OT: A big assumption that broadcasters transmit on time, there is nearly
always a couple of minutes betweens shows, but when they do then 15 secs
lead-in is better than missing the beginning.

You don't have to follow my syntax could do it like:
| t = CronTimer(callback)
| t.at((min=15,sec=30))
| t.at((min=20))
| t.list() => [ "*:15:30", "*:20:00" ]
| t.remove(t.list()[0])
| t.list() => [ "*:20:00" ]

| t.at(sec=45)

Duncan


-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to