PureMVC
Home
About
Code
Docs
FAQ
Forums
News
Showcase
Contact
Jobs
Welcome,
Guest
. Please
login
or
register
.
June 19, 2013, 12:01:14 AM
News:
ATTENTION: Spambots must die! Humans must visit
http://contact.futurescale.com
to request forum access.
PureMVC Architects Lounge
Announcements and General Discussion
Getting Started
Is it OK for Commands to trigger other Commands?
Pages: [
1
]
« previous
next »
Author
Topic: Is it OK for Commands to trigger other Commands? (Read 657 times)
caista
Newbie
Posts: 5
Is it OK for Commands to trigger other Commands?
«
on:
April 24, 2012, 06:15:47 AM »
Hi,
This is a really simple one but I´ve had a search around and I can´t find anything about it.
I have a Proxy that receives some data from a server and sends a Notification that triggers a Command which then parses that data.
However, the amount of parsing is enormous and I would like to share the work. Is it OK to have the first Command do some of the work and then trigger other Commands through Notifications to finish off the job?
I´m guessing that would be fine, but I can´t find any examples of other people doing it.
Thanks in advance!
Logged
puremvc
Global Moderator
Hero Member
Posts: 2791
Re: Is it OK for Commands to trigger other Commands?
«
Reply #1 on:
April 24, 2012, 07:23:46 AM »
You can certainly do that, but remember Flash is single-threaded, so these other Commands will not be operating in parallel.
So if the theory was: '
split the data into 4 chunks and fire off 4 Notifications to deal with those chunks
', then you're best off just doing the whole batch in the first Command.
However, if the theory was: '
Rather than coding 4 different processes in a single command, do each process in a separate command and execute them one after another, passing the result of one command to the next
' then you're on the right track.
In fact, you could make a MacroCommand that has the 4 processing Commands as sub-commands. Each Command is executed with the same Notification instance that triggered the MacroCommand. And you can write to that note. So, Command 1 could find the data in the body of the note, execute its process and set the result back as the body of the note before finishing. Then Command 2 would receive the result of Command 1, ready to have the second process applied.
Hope this helps,
-=Cliff>
Logged
Pages: [
1
]
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Announcements and General Discussion
-----------------------------
=> General Discussion
=> Getting Started
=> Architecture
=> Public Demos, Tools and Applications
===> Fabrication
-----------------------------
PureMVC Manifold
-----------------------------
=> Port Authority
===> Contributor Central
===> Client Side
===> Server Side
=> Port to AS2
===> Standard Version
=====> Bug Report
=====> Demos and Utils
=> Port to AS3
===> Standard Version
=====> Bug Report
=====> Demos and Utils
===> MultiCore Version
=====> Bug Report
=====> Demos and Utils
=> Port to ColdFusion
===> Standard Version
=====> Bug Report
=====> Demos and Utils
=> Port to C++
===> MultiCore Version
=====> Demos and Utils
=====> Bug Report
=> Port to CSharp
===> Standard Version
=====> Bug Report
=====> Demos and Utils
=> Port to Dart
===> MultiCore Version
=====> Bug Report
=====> Demos and Utils
=> Port to Haxe
===> Standard Version
=====> Bug Report
=====> Demos and Utils
===> MultiCore Version
=====> Bug Report
=====> Demos and Utils
=> Port to Java
===> Standard Version
=====> Bug Report
=====> Demos and Utils
===> MultiCore Version
=====> Bug Report
=====> Demos and Utils
=> Port to JavaScript
===> Demos and Utils
===> Native JS Branch
=====> Bug Report
===> PrototypeJS Branch
=====> Bug Report
===> Objs Branch
=====> Bug Report
===> MooTools Branch
=====> Bug Report
===> ExtJS Branch
=====> Bug Report
=> Port to Objective C
===> Standard Version
=====> Bug Report
=====> Demos and Utils
=> Port to Perl
===> Standard Version
=====> Bug Report
=====> Demos and Utils
===> MultiCore Version
=====> Bug Report
=====> Demos and Utils
=> Port to PHP
===> Standard Version
=====> Bug Report
=====> Demos and Utils
===> MultiCore Version
=====> Bug Report
=====> Demos and Utils
=> Port to Python
===> Standard Version
=====> Bug Report
=====> Demos and Utils
===> MultiCore Version
=====> Bug Report
=====> Demos and Utils
=> Port to Ruby
===> Standard Version
=====> Bug Report
=====> Demos and Utils
=> Port to TypeScript
===> Standard Version
=====> Bug Report
=====> Demos and Utilities
===> MultiCore Version
=====> Bug Report
=====> Demos and Utilities
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Powered by SMF 1.1.11
|
SMF © 2006-2007, Simple Machines LLC
Loading...
Copyright © 2006-2008 Futurescale, Inc.