tag:robotlegs.tenderapp.com,2009-10-18:/discussions/questions/184-conceptual-location-for-timersRobotlegs: Discussion 2018-10-18T16:35:13Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/18624082010-06-06T20:57:01Z2010-06-06T20:57:01ZConceptual Location for Timers?<div><p>Hi Mike,</p>
<p>I have 2 kinds of timers: Models and Services.</p>
<p>The service kind simply dispatch an application specific event
at a regular interval. They don't really have 'state' as such.
Public functions wouldn't run beyond start / stop functionality.
They do little more than wrap a Timer() and dispatch a custom event
rather than a generic TimerEvent.</p>
<p>The model kind have other public methods such as getters /
setters. They hold state such as number of loops, time started
etc.</p>
<p>Not sure that's 'correct' but it works for me!</p></div>Straytag:robotlegs.tenderapp.com,2009-10-18:Comment/18624082010-06-06T21:05:50Z2015-10-19T23:47:51ZConceptual Location for Timers?<div><p>Hi Stray,</p>
<p>That sounds good to me :)</p>
<p>Cheers!<br>
Mike</p></div>mike.canntag:robotlegs.tenderapp.com,2009-10-18:Comment/18624082010-06-07T12:46:54Z2010-06-07T12:46:55ZConceptual Location for Timers?<div><p>Hey,</p>
<p>I'm glad this came up, I had the same scenario a while back when
I made a Flash IDE panel. I had a service that handled the calls
made the Flash IDE via jsfl, but did not want the work load to
happen all in one loop. So I broke the loop down into 10
millisecond intervals with a timer. I ended up making the timer
dispatch from a mediator, but it didn't feel right. Reading the
above made me realize that the timer should have been inside the
service and handled internally.</p>
<p>Cool :)</p></div>Matan Uberstein