Re: Is it ever possible for an asynchronous service method's callback to get called without yielding to the browser's event loop?

2011-08-12 Thread Karthik Reddy
See the example under *Non-Blocking / Asynchronous:*  and it gives a clear 
example addressing Tad's question:

http://quickleft.com/blog/142

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/0bs5XTEIFt4J.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Is it ever possible for an asynchronous service method's callback to get called without yielding to the browser's event loop?

2011-06-23 Thread Tad
Thomas,

Yes, I believe that is the answer I was looking for.

-Tad

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Is it ever possible for an asynchronous service method's callback to get called without yielding to the browser's event loop?

2011-06-18 Thread Derek
The only time I encounter what you describe is when I mock the server
side code on the client side. In other words, in your code example, I
might have myRemoteService actually be an instance of some
MyRemoteServiceAsyncMock, that returns dummy data while I wait for
someone else to write the server side impl (or until I do it myself).
In that case the async call is actually sync and so I might need a
deferred command to make sure that code outside the async call is run
before the call itself. Otherwise you should be able to count on
things happening in the expected order.

On Jun 17, 12:29 pm, Tad tadwo...@gmail.com wrote:
 Is the AsyncCallback framework implemented in such a way that when a
 RemoteService method is called, is it a GUARANTEE that the browser's
 event loop will execute at least one cycle before its callback (i.e.
 onSuccess or onFailure) gets called?

 For example:

 ...some code...
 myRemoteService.myMethod( myParameter, new AsyncCallbackString()
 {
    public void onSuccess(String result)
    {
       
    }});

 ...some long running code...

 In the above example, if the result of myMethod happens to return
 before the some long running code finishes, will the browser's event
 loop always receive at least one cycle before onSuccess() is called?
 Or is it ever possible that onSuccess() could get called without
 yielding to the browser's event loop?

 Another way to ask this question would be: Is there ever a scenario
 where it is necessary to do the following (or put the scheduleDeferred
 call inside myMethod's onSuccess callback)?

 Schedule.get().scheduleDeferred( new ScheduledCommand()
 {
    myRemoteService.myMethod( myParameter, new AsyncCallbackString()
    {
       public void onSuccess(String result)
       {
          
       }
    });

 });

 -Tad

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Is it ever possible for an asynchronous service method's callback to get called without yielding to the browser's event loop?

2011-06-17 Thread Tad

Is the AsyncCallback framework implemented in such a way that when a
RemoteService method is called, is it a GUARANTEE that the browser's
event loop will execute at least one cycle before its callback (i.e.
onSuccess or onFailure) gets called?

For example:

...some code...
myRemoteService.myMethod( myParameter, new AsyncCallbackString()
{
   public void onSuccess(String result)
   {
  
   }
});
...some long running code...

In the above example, if the result of myMethod happens to return
before the some long running code finishes, will the browser's event
loop always receive at least one cycle before onSuccess() is called?
Or is it ever possible that onSuccess() could get called without
yielding to the browser's event loop?

Another way to ask this question would be: Is there ever a scenario
where it is necessary to do the following (or put the scheduleDeferred
call inside myMethod's onSuccess callback)?

Schedule.get().scheduleDeferred( new ScheduledCommand()
{
   myRemoteService.myMethod( myParameter, new AsyncCallbackString()
   {
  public void onSuccess(String result)
  {
 
  }
   });
});

-Tad

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Is it ever possible for an asynchronous service method's callback to get called without yielding to the browser's event loop?

2011-06-17 Thread Thomas Broyer
GWT-RPC makes use of RequestBuilder, which is based on XMLHttpRequest. 
XMLHttpRequest (XHR) uses events to communicate back with the code, so 
anything happening on an XHR results in an event being pushed on the event 
queue, and dequeued by the event loop.
Does that answer your question?

More details of how browsers behave (or should/will behave in the near 
future) can be found in the HTML5 spec http://www.whatwg.org/html5 or 
http://www.w3.org/TR/html5

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/yGccJfGZqIwJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.