[flexcoders] How to asynchronously dispatch an event

2007-03-23 Thread pgp.coppens
Hello,

I am designing an api that manages a data model. Some of the methods
on the data model will trigger a server service (HTTPService), and
will therefore be handled asynchronously (no choice there). Other
actions, not going to the server, would be synchronous. 

I would like to give the user of the api a consistent (asynchronous)
view of the api but I can not seem to create asynchronous behavior. 

dispatchEvent seems to always synchronously invoke registered event
handlers.

Is there a way to have a class method trigger an asynchronous event?

Thanks in advance,

Peter



Re: [flexcoders] How to asynchronously dispatch an event

2007-03-23 Thread John Mark Hawley
Why would it matter for the API whether or not event dispatching was 
asynchronous? Clients still listen for events and hear them; the only 
difference would be that the stack would get taller on the sync calls.

If you *really* needed to make ape async behavior, you could have the sync 
methods use a doLater() method to wait a frame before broadcasting an event.

-Mark Hawley

 
 From: pgp.coppens [EMAIL PROTECTED]
 Date: 2007/03/23 Fri AM 07:30:48 CST
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] How to asynchronously  dispatch an event
 
 Hello,
 
 I am designing an api that manages a data model. Some of the methods
 on the data model will trigger a server service (HTTPService), and
 will therefore be handled asynchronously (no choice there). Other
 actions, not going to the server, would be synchronous. 
 
 I would like to give the user of the api a consistent (asynchronous)
 view of the api but I can not seem to create asynchronous behavior. 
 
 dispatchEvent seems to always synchronously invoke registered event
 handlers.
 
 Is there a way to have a class method trigger an asynchronous event?
 
 Thanks in advance,
 
 Peter
 
 
 

--
John Mark Hawley
The Nilbog Group
773.968.4980 (cell)



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* Your email settings:
Individual Email | Traditional

* To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)

* To change settings via email:
mailto:[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/