Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought

Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Author Topic: perform repetitively at regular interval in PureMVC based project  (Read 10612 times)
Posts: 1

View Profile Email
« on: February 09, 2012, 07:20:21 »

Currently working on a AIR project based on PureMVC framework. There was a new requirement to the project, an operation is to be performed repetitively at regular interval which would have some business logic.

I would be placing the business logic in a command, but then question what comes up is where and who should be triggering this command at specific interval. As of now I have trigger to call command in a mediator. Is this correct?

How do I find a solution for this kind of scenario?
Sr. Member
Posts: 192

View Profile WWW Email
« Reply #1 on: February 11, 2012, 06:30:35 »

For my part I use a SchedulerProxy. It has a method which receives a notification name and a number of milliseconds as parameters. It dispatches the named notification every N milliseconds and so can be used by both Command or a Mediator. The proxy also have some methods to manage the scheduled notifications map. I think I use the notification name as an ID. It could be better built and use a unique interval ID. I even thought to publish this as a PureMVC Extension for JavaScript.
Global Moderator
Hero Member
Posts: 2871

View Profile WWW Email
« Reply #2 on: February 12, 2012, 09:47:10 »

@Tekool, that's the right answer. Such a utility would be certainly handy off the shelf.
Pages: [1]