Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought

Welcome, Guest. Please login or register.
November 24, 2017, 02:53:37 PM
Home Help Search Login Register
News: Please DM @puremvc on Twitter to gain forum access. Spambots are why we can't have nice things.
Pages: [1]
Author Topic: perform repetitively at regular interval in PureMVC based project  (Read 2949 times)
Posts: 1

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

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
« Reply #1 on: February 11, 2012, 06:30:35 AM »

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
« Reply #2 on: February 12, 2012, 09:47:10 AM »

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