incubator-flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Mclean <jus...@classsoftware.com>
Subject Re: Actionscript workers and async locking?
Date Mon, 26 Mar 2012 08:15:50 GMT
Hi,

> I feel like a lot of people tried and are trying to address the
> disadvantages of coding async control flows. So I ask myself again:
> with worker threads, wouldn't it be simpler to just ask to synchronize
> the thread on the async token, i.e. locking it until result/fault?

In general this would work for a string of calls one after the other where each call depends
on the results of  the previous call. 

However you may want to make 3 async calls and then when you get all 3 back (which may return
in a different order each time) then make another call if they all worked.

In this case I've at various times used different way of solving this by using event maps,
counting no of successful calls before making another, setting concurrency and made code independent
of the order the calls return in.

I'm not sure that worker threads can really help with making async calls (but happy to be
convinced otherwise).

Re locking there is a property on both the web service and remote classes which would act
the same way as locking. Just set concurrency to "single".

Thanks,
Justin
Mime
View raw message