1

I'm building a simple task manager that will at this moment execute tasks in a serial manner. I have been reading about threads in flex and it seems it is not quite clear/prepared for real threads.

What I'm looking at this moment is a way to execute a method at the beginning or end of a flash builder update. This method will be the one that will take the responsibility to start tasks added in the previous update. The removing of finished tasks will be done through event notification (the task will notify it finished) then the scheduler will remove it and dispatch the message again to let the outside world know the task was over.

A rough workflow of the system woudl be:

1) Add Tasks to the scheduler. And listen to events of the task (finished, etc...)

2) At the beginning/ End of a flex update (don't know if this really happen) Start tasks waiting. And run tasks that have a runnable method per update.

3) When a task finishes it notifies the scheduler and it is removed from the scheduler queue and redispatches the event to let the outside world the task finsihed.

Could anybody suggest the correct place to have a method like this? Any suggestion to the scheduler?.

Thanks in advance,

Aaron.

user777231
  • 23
  • 4

1 Answers1

2

Based on your description you don't seem to be doing anything new and that unique. I'd start first with researching existing task and concurrency solutions. If they won't do what you want, extending the code will probably still be easier than starting from scratch.

Get familiar first with Cairngorm 3 Tasks and/or Parsley Tasks.

Also take a look at the callLater() method.

Finally there is the GreenThreads project.

Kevin Gallahan
  • 1,645
  • 10
  • 9