I have logged the request - # BLZ-185. Plus I have voted for BLZ-184, as I can see how this could affect us in other situations. Perhaps if enough people vote on both, a consolidated effort can be made to review asynchronicity across BlazeDS? Regards Tim
________________________________ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Seth Hodgson Sent: Saturday, 24 May 2008 2:59 AM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: Async Concurrent Requests with AMF for BlazeDS or LCDS Hi Tim, Yeah, it's the same issue. With proxied calls though, it's a bit more complicated to solve. In the remoting case, your remote object method is generally just doing some local computation on the server and maybe hitting a database. It's simple to wrap this up in a Runnable and execute it asynchronously. In the case of the proxy service, we use the Apache HttpClient library to make proxied calls on your behalf, and this would be _much_ harder for you to wrap up in a Runnable to execute concurrently. I'd like to see us support async mode for the proxy service as well as for the remoting service, and the proxy service itself should be updated to use NIO to support making proxied calls that don't tie up a server thread for the duration of the proxy request. Right now, in BlazeDS, because Servlet IO is blocking, when you make a proxy service call that hits our server the servlet request handler thread has to wait for the proxy request to return before it can return. So you tie up the thread for the duration of the call which could take awhile. Would you mind logging an enhancement request for async proxy service support in our bugbase? Thanks, Seth From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> [mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> ] On Behalf Of Tim Stewart Sent: Thursday, May 22, 2008 9:56 PM To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> Subject: RE: [flexcoders] Re: Async Concurrent Requests with AMF for BlazeDS or LCDS Hi Seth, could you say whether this is similar to the limitation in LiveCycle / Blaze proxy service, which causes multiple web service calls to be queued and executed in sequence rather than simultaneously - and whether there could be a similar approach to working around this? I have an application that calls several web services at startup, and the sequential vs. simultaneous thing really slows it down. Regards Tim ________________________________________ From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> [mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> ] On Behalf Of MyoT Sent: Friday, 23 May 2008 11:17 AM To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> Subject: [flexcoders] Re: Async Concurrent Requests with AMF for BlazeDS or LCDS Hi Seth, This is awesome information. I didn't know player batch them up and send in one post. I learned something today. I digged through Blaze source code and found out that "BatchProcessFilter" is responsible for processing those messages . I am wondering is there any way, I can write our own batch process filter and plug that in instead of default one. What I am thinking is to process those messages in parallel on server then response to the client in one response. Basically, it would cut down the time server has to wait to finish processing all those messages sequentially. Any thoughts or insight info would be appreciated. Thanks, Jay --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> , "Seth Hodgson" <[EMAIL PROTECTED]> wrote: > > There is a single thread that advances through SWF frames and runs your > ActionScript code and event handlers, but network calls are performed by > separate background threads concurrently. > > In order to have calls processed concurrently on the server, they need > to arrive as separate requests. In the case of AMF, if you make a series > of calls quickly chances are good/excellent that the Player will batch > them up and send them to the server in the body of a single HTTP POST. > When this happens, the server must unpack them and process them serially > and then pack the results for all these calls back up in the body of a > single HTTP response. Because we're dealing with a single request and > response, there's no way to send back results for individual calls > separately. When these results get back to the browser and are passed > back into the Player, they are dispatched to your ActionScript handling > code as asynchronous events. There's not a good way to force calls to be > sent as separate requests, and even if you could, browsers impose limits > on the number of concurrent connections they'll open to a server, so > this really isn't the right way to solve your scenario. Also, in the > case of RTMP all traffic between the client and server happens over a > single connection and is ordered serially. > > > > If you want to process calls/messages/data asynchronously on the server > the proper way, it requires a bit of work on your part to accomplish at > this point. Rather than running your current logic in your RemoteObject > directly when it is invoked, you need to break that out into a Runnable > class, and when you're invoked, create an instance of this class that > packages up the incoming args and info about the client making the call > and then submit that for asynchronous execution to a > java.util.concurrent.Executor that you'd need to set up during server > startup. Your remoting method could return a job id or just void once it > has queued an instance of your Runnable with the Executor. On the client > when you get a ResultEvent for your call you don't get the actual result > - you just know that your invocation was successfully queued for > asynchronous execution on the server. So the second half of the equation > is how to get the result or fault generated when the Executor runs your > Runnable back to the client. You need to take advantage of messaging in > BlazeDS or LCDS to achieve this. In your client app, create a Consumer > and subscribe to a destination you define that you can publish > results/faults as AsyncMessages back to target clients from your > Runnable. Your Consumer should subscribe to a subtopic that applies only > to it, or use a selector expression. When your Runnable runs and > generates the result or fault to return, you'd can create an > AsyncMessage containing the result of fault info and publish it to this > destination, using either a subtopic header, or some other message > header that will be evaluated against the Consumer's selector expression > such that the message is routed to the proper Consumer. That lets you > return async results or faults to clients in a truly asynchronous > manner. > > > > This is actually something I'd like to see us bake into the product > directly. Would one of you on the thread log an enhancement request here > and the rest of you vote for it: https://bugs.adobe.com/blazeds/ <https://bugs.adobe.com/blazeds/> > > No promises because resourcing is always a juggle but lots of people ask > for this, I'd like to see it happen, and your votes matter J > > > > Seth > > > > From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> [mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> ] On > Behalf Of MyoT > Sent: Thursday, May 22, 2008 10:49 AM > To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> > Subject: [flexcoders] Re: Async Concurrent Requests with AMF for BlazeDS > or LCDS > > > > If Flex (Flash) uses async request, does Single Threaded matter? > > I tried to have more than one channel, it doesn't help either. > > - Jay > > --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> <mailto:flexcoders%40yahoogroups.com> > , "twcrone70" <twcrone70@> wrote: > > > > Your server code might be able to run things concurrently but unless I > > misread something, Flash is currently single threaded I believe. So > > actually sending the requests at the 'same time' is difficult if even > > possible. > > > > - Todd > > > > --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> > <mailto:flexcoders%40yahoogroups.com> , "MyoT" <bighead007us@> wrote: > > > > > > Hi There, > > > > > > I am wondering is there any way, you can make concurrent requests to > > one destination via > > > RemoteObject over AMF. > > > > > > Basically, I want to issue multiple request of getItem operations to > > one destination. Currently, > > > my command is making multiple async requests but RemoteObject > > doesn't seem to be calling > > > server concurrently. Server got those request in sequential. > > > > > > Any help or pointer would help. > > > > > > Thanks in advance, > > > Jay > > > > > >