Skip to content

andrewpowell/swiz-timer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

This is the custom metadata processor for [Scheduled] metadata.

USAGE:

[Scheduled("5000")]

[Scheduled(delay="5000")]

[Scheduled(delay="5000", repeatCount="5")]

Use the TimerManagementEvent to stop or reset the timer for a given function name.

USAGE:

var tmEvent:TimerManagementEvent = new TimerManagementEvent(TimerManagementEvent.STOP_TIMER,"exampleOne");
dispatchEvent(tmEvent);

var tmEvent:TimerManagementEvent = new TimerManagementEvent(TimerManagementEvent.RESET_TIMER,"exampleOne");
dispatchEvent(tmEvent);

Namespace URL:  http://timer.swizframework.org



Changed by TJ Downes (12/14/2010):
Modified for Swiz 1.0. TimerManagementEvent used to extend EventChainStep, which was incompatible with Swiz 1.0

Also added capability to change schedules at runtime Before doing this, you must name your processor in your configuration: 

<swiz:customProcessors>
    <processors:ScheduledProcessor id="schedules" xmlns:processors="org.swizframework.processors.*"/>
</swiz:customProcessors>


example showing how to change schedule at runtime:

var interval:Number = 2 //minutes

var app:MyApp = FlexGlobals.topLevelApplication as MyApp;

app.schedules.timers['NameOfFunctionUsedForSchedule'].tag.delay = interval*60*1000;

var event:TimerManagementEvent = new TimerManagementEvent(TimerManagementEvent.RESTART_TIMER, 'NameOfFunctionUsedForSchedule');

swizdispatcher.dispatchEvent(event);

About

Scheduled Metadata Tag processor for the Swiz Framework

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published