You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by Oleg Konovalov <ol...@gmail.com> on 2013/04/24 05:18:49 UTC

Parsley handling 2 async calls

Hi,



I am fairly new to Parsley.



We have a Flex app which needs tons of data to display (gets many different
resultsets of various kinds),

so up until new were making 1 service call via REST-to-SOAP bridge,

but it is often timeout (> 1 min),

so we decided to split the call in 2 services (one is fairly light, and
everybody needs that data,

second is heavy and most users don't care about it).

Results are displayed on the same tab.



Can CallResponder process 2 service call results?



Would it be done like that in Parsley:

[CommandResult (type="resultset1"]

protected handleResult1(obj1:Object) : void {,,,}



and:



[CommandResult (type="resultset2"]

protected handleResult2(obj2:Object) : void {,,,}



Can one Command handle 2 resultsets?



Any suggestions?  Code samples?



Please advise.

There is nobody else around me who have done something similar.



Using Flex 4.6 & Parsley 2.4





Thank you in advance,
Oleg

Re: Parsley handling 2 async calls

Posted by Frédéric THOMAS <we...@hotmail.com>.
I recently used Parsley 3.0 and the Command API changed from 2.4, so I won't 
provide any examples but the idea will be to create 2 commands, each of them 
will put the result in a model and your UI will be bound to this model, so 
depending of your needs, you may want to send a message at view/app startup 
to trigger your first command that will get the common data, store them in a 
model, then, after a user action, send another message to trigger the second 
command, when the result is here, store the data into the model and because 
your view is bound to the model, it will be updated accordingly.

You can check the chapters 6.9 and 6.10 from 
http://www.spicefactory.org/parsley/docs/2.4/manual/

or

the chapter 7 Managed Commands from 
http://www.spicefactory.org/parsley/docs/3.0/manual/ if you want to upgrade 
to Parsley 3.0 which is a redesign of the Command API and gives you the 
possibility  to chain executed commands and more.

-Fred

-----Message d'origine----- 
From: Oleg Konovalov
Sent: Wednesday, April 24, 2013 5:18 AM
To: users@flex.apache.org
Subject: Parsley handling 2 async calls

Hi,



I am fairly new to Parsley.



We have a Flex app which needs tons of data to display (gets many different
resultsets of various kinds),

so up until new were making 1 service call via REST-to-SOAP bridge,

but it is often timeout (> 1 min),

so we decided to split the call in 2 services (one is fairly light, and
everybody needs that data,

second is heavy and most users don't care about it).

Results are displayed on the same tab.



Can CallResponder process 2 service call results?



Would it be done like that in Parsley:

[CommandResult (type="resultset1"]

protected handleResult1(obj1:Object) : void {,,,}



and:



[CommandResult (type="resultset2"]

protected handleResult2(obj2:Object) : void {,,,}



Can one Command handle 2 resultsets?



Any suggestions?  Code samples?



Please advise.

There is nobody else around me who have done something similar.



Using Flex 4.6 & Parsley 2.4





Thank you in advance,
Oleg