[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-dev] Timers



There's also the case of stopping a periodic timer, then it's not only
enough to disable the evaluation of a function.

Surely one can combine stuff to get a cancelable timer, but that would
never be as straight forward as a dedicated timer class.

Another solution would be to add the ability to unschedule an item
previously scheduled on a clock. I think it would work by popping all
items from the prioQ, and discard the one to be removed, and push the
rest back again. This might be a good thing to have anyway, even if we
add a dedicated simple timer class.


On Sun, Dec 30, 2012 at 4:58 AM, Scott Wilson <s.d.wilson@xxxxxxxxxx> wrote:
> Perhaps something more general would be useful, i.e. a wrapper which evaluates only conditionally would give the cancel-ability and also be useful for other purposes.
>
> Fdef could be used for this already I suppose.
>
> S.
>
> On 29 Dec 2012, at 15:11, Jonatan Liljedahl wrote:
>
>> SkipJack has a few differences:
>> - the name of the class has nothing to do with "timer"
>> - survives cmdPeriod (as you said)
>> - most importantly, it always repeats, no one-shot timers
>>
>> Also it's rather complex compared to a simple lightweight timer, due
>> to the cmdperiod-survival and storing skipjacks by name, etc. I think
>> SkipJack has a clear and useful purpose (periodic timer that survives
>> cmdPeriod), and that it would be nice with a separate simple and clear
>> timer class similar or equal to the one I posted, instead of extending
>> SkipJack.
>>
>> On Sat, Dec 29, 2012 at 9:31 PM, Jakob Leben <jakob.leben@xxxxxxxxx> wrote:
>>> On Sat, Dec 29, 2012 at 4:54 PM, Jonatan Liljedahl <lijon@xxxxxxxxxxxx> wrote:
>>>> sclang does not have Timers, in the usual sense of timers in other
>>>> languages, like NSTimer in obj-c.
>>>>
>>>> There is someClock.sched, but those are not cancelable.
>>>
>>> Well, there is SkipJack. It survives CmdPeriod, but could easily be
>>> extended to not...
>>>
>>> _______________________________________________
>>> sc-dev mailing list
>>>
>>> info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
>>> archive: https://listarc.bham.ac.uk/marchives/sc-dev/
>>> search: https://listarc.bham.ac.uk/lists/sc-dev/search/
>>
>>
>>
>> --
>> /Jonatan
>> http://kymatica.com
>>
>> _______________________________________________
>> sc-dev mailing list
>>
>> info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
>> archive: https://listarc.bham.ac.uk/marchives/sc-dev/
>> search: https://listarc.bham.ac.uk/lists/sc-dev/search/
>
>
> _______________________________________________
> sc-dev mailing list
>
> info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
> archive: https://listarc.bham.ac.uk/marchives/sc-dev/
> search: https://listarc.bham.ac.uk/lists/sc-dev/search/



-- 
/Jonatan
http://kymatica.com

_______________________________________________
sc-dev mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-dev/
search: https://listarc.bham.ac.uk/lists/sc-dev/search/