« Return to Thread: Pure pub/sub behavior in Reverse Ajax

Re: Pure pub/sub behavior in Reverse Ajax

by chago :: Rate this Message:

Reply to Author | View in Thread

I see that _poll() does keep the connection open, but is there any support to do this?

1. invoke _poll()
2. make a DWR call to a long-running remote method on the server
3. return from the DWR call immediately. No callbacks are invoked. (Server side obviously makes an async call to process the request and the client has to store the callback method until a response is received.)
4. When the response is ready, it is returned via the _poll() connection.
5. The client marries the response to its original callback method and invokes.

I have the above working with ActiveMQ and their AJAX gateway. The problem I am facing is that they only support the transmission of XML data, so I added the DWR conversion classes to their stack and now I can send JSON down to the client. Now I want to add this type of disconnected request-response to their client javascript.

As I'm adding all of this DWR goodness to their stack, I'm realizing it would be nicer if I added a JMS "creator" to DWR. However, there may be some major architectural hurdles if your _poll() routine does not work the way I describe above.

What I like about the pure messaging route is a long-running server side process will block the DWR calls even when I am using Reverse AJAX. Just two of them and my client will freeze (because the _poll() is using one of two connections).

Joe Walker-3 wrote:
_poll() does by default keep the connection open (or to be more accurate, it
asks the server to keep the connection open).

RC4 (out later on today, I hope) has some fixes for Jetty in embedded mode.

Joe.

On 4/2/07, chago <nabble@visualxs.com> wrote:
>
>
> I have an expectation from Reverse AJAX that may not be compatible with
> DWR's
> implementation. I was wondering if someone can clear this up, or if I am
> just seeing an outstanding bug:
>
> http://www.nabble.com/Jetty-and-Reverse-Ajax-Performance-tf3366524.html#a9394546
>
> I am testing the clock example that uses comet to send a ScriptBuffer to a
> client every second. I am also using Jetty in embedded mode on the server
> and FF 2.0.0.3 on the client. The call to dwr.engine._poll() is occuring
> just fine when my page loads. (I am seeing a call to _poll() timeout every
> 10 successive calls or so, as others have reported.)
>
> My question is whether I should expect regular DWR calls to return their
> results on the _poll() connection, or do these calls keep their own
> connection open until the server has satisfied their request?
>
> Thanks,
> Jim
> --
> View this message in context:
> http://www.nabble.com/Pure-pub-sub-behavior-in-Reverse-Ajax-tf3506668.html#a9793824
> Sent from the DWR - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@dwr.dev.java.net
> For additional commands, e-mail: users-help@dwr.dev.java.net
>
>

 « Return to Thread: Pure pub/sub behavior in Reverse Ajax