You can do everything that you want to do in Flex. But due to the threadless execution model, you will need to arrange for the response from each server side operation to trigger the "next thing" via a result event handler, whatever that next thing is.

Typically this involves breaking the overall process up in a different way than you would if you were using traditional RPCs.

RPC-oriented view:

// code segment 1
synchronousCall1();
// code segment 2
synchronousCall2();
// code segment 3
synchronousCall3();

Async messaging view:

function beginProcess() {
// code segment 1
asynchronousCall1(); // resultHandler1 invoked when done
}

function resultHandler1() {
// code segment 2
asynchronousCall2(); // resultHandler2 invoked when done
}

function resultHandler2() {
...etc...
}

I've left a lot out here (how you arrange for the handlers to be invoked is up to you; you could use raw remote objects and MXML components, or use Cairngorm, or...) but that's the basic concept.

. . . . ...j



Carson Hager wrote:
What if I have to interrogate the database or some other server side operation to determine the business rule response?


Carson

____________________________________________

Carson Hager
Cynergy Systems, Inc.
http://www.cynergysystems.com <http://www.cynergysystems.com/>

Email: [EMAIL PROTECTED]
Office: 866-CYNERGY ext. 89
Mobile: 1.703.489.6466

Take PowerBuilder to the Web with EAF 4.0
http://www.cynergysystems.com/public/products/eaf




------------------------------------------------------------------------ *From:* Robert Stuttaford [mailto:[EMAIL PROTECTED] *Sent:* Monday, March 07, 2005 3:01 PM *To:* flexcoders@yahoogroups.com *Subject:* RE: [flexcoders] Equivalent to Thread.sleep()

Entrust your business logic processing to the client-side; after all, it isn’t just HTML and Javascript any more J



------------------------------------------------------------------------

*From:* Carson Hager [mailto:[EMAIL PROTECTED]
*Sent:* 07 March 2005 09:57 PM
*To:* flexcoders@yahoogroups.com
*Subject:* RE: [flexcoders] Equivalent to Thread.sleep()



There are plenty of occasions where we are using web services for something other than data feeds. For example, there are plenty of business rule checks that we need to perform during the course of some application logic, the results of which will determine the path within conditional logic. We need to do server processing to get a response to our business rule checks and remoting is not an option due to the proprietary nature of the binary protocol and the need for our app to run outside of the firewall. This would be ridiculous to do in an asynch fashion. Only having asynch capability in Flex is yet again another feather in its Hello World cap. This is a major issue if it is indeed the case.



I appreciate your help but I really don't understand how anyone can think this is acceptable.




Carson

____________________________________________

Carson Hager
Cynergy Systems, Inc.
http://www.cynergysystems.com <http://www.cynergysystems.com/>

Email: [EMAIL PROTECTED]
Office: 866-CYNERGY ext. 89
Mobile: 1.703.489.6466

Take PowerBuilder to the Web with EAF 4.0
http://www.cynergysystems.com/public/products/eaf







------------------------------------------------------------------------

*From:* Tracy Spratt [mailto:[EMAIL PROTECTED]
*Sent:* Monday, March 07, 2005 1:47 PM
*To:* flexcoders@yahoogroups.com
*Subject:* RE: [flexcoders] Equivalent to Thread.sleep()

As far as I know, this can’t be done. The flash player is single threaded, so nothing else happens in a timer loop, nothing will “return”. It seems like there should be a way to hack this, maybe using doLater() and setInterval(), but I have never heard of one.



What is your functional reason for not using the result event? Once I got used to async handling, using the ACT (asynchronous call token) pattern with the “call” object, I go over my irritation with the relative complexity and learned to like the async data calls.



Tracy



------------------------------------------------------------------------

*From:* Carson Hager [mailto:[EMAIL PROTECTED]
*Sent:* Monday, March 07, 2005 1:15 PM
*To:* flexcoders@yahoogroups.com
*Subject:* RE: [flexcoders] Equivalent to Thread.sleep()



Basically, I'm trying to stop executiong of a function until the result returns. When it returns, I want to get the result and return it as the return value to the function..basically a wrapper around a web service call that provides a synchronous response to the calling code. Any ideas on how to do this?





Thanks,



Carson

____________________________________________

Carson Hager
Cynergy Systems, Inc.
http://www.cynergysystems.com <http://www.cynergysystems.com/>

Email: [EMAIL PROTECTED]
Office: 866-CYNERGY ext. 89
Mobile: 1.703.489.6466

Take PowerBuilder to the Web with EAF 4.0
http://www.cynergysystems.com/public/products/eaf







------------------------------------------------------------------------

*From:* Dimitrios Gianninas [mailto:[EMAIL PROTECTED]
*Sent:* Monday, March 07, 2005 11:47 AM
*To:* flexcoders@yahoogroups.com
*Subject:* RE: [flexcoders] Equivalent to Thread.sleep()


Hi,



There is no equivalent. Are you try to make sure that when one call is finished the next one is executed (but only when the first one completed)? You can easily achieve this by making the second call once the result for the first one has been received.



**Jimmy Gianninas**

**Software Developer -**** ****Optimal Payments Inc.**





------------------------------------------------------------------------

*From:* Carson Hager [mailto:[EMAIL PROTECTED]
*Sent:* Sunday, March 06, 2005 6:19 PM
*To:* flexcoders@yahoogroups.com
*Subject:* [flexcoders] Equivalent to Thread.sleep()

Is there something in Flex that will put a thread to sleep for a period of time? I'm implementing a framework to effectively allow synchronous invocation of web services from action script. I need to be able to put the thread to sleep for a period of time and check to see whether the results have made it back to the internal result handler. I've searched the docs and have not found anything yet. Any clever ideas how to do this?



Thanks,

Carson

____________________________________________

Carson Hager
Cynergy Systems, Inc.
http://www.cynergysystems.com

Email: [EMAIL PROTECTED]
Office: 866-CYNERGY ext. 89
Mobile: 1.703.489.6466











*Yahoo! Groups Sponsor*
ADVERTISEMENT
click here <http://us.ard.yahoo.com/SIG=129tc6fui/M=298184.6018725.7038619.3001176/D=groups/S=1705007207:HM/EXP=1110312522/A=2593423/R=0/SIG=11el9gslf/*http://www.netflix.com/Default?mqso=60190075>



------------------------------------------------------------------------ *Yahoo! Groups Links*

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

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

* Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service <http://docs.yahoo.com/info/terms/>.








Reply via email to