RPC without a callback

169 views
Skip to first unread message

zhc...@gmail.com

unread,
Feb 12, 2008, 12:24:19 AM2/12/08
to Google Web Toolkit
Hi guys,

I wonder is it possible to create an RPC without callback?

I imagine to use this while I am closing the window, I dont need
server response, I simply let server know that he should clean up some
session data.

walden

unread,
Feb 12, 2008, 8:19:36 AM2/12/08
to Google Web Toolkit
Just drop the response on the floor, and no one will be the wiser.
Bits, unlike buttered and jelly'd bread, don't really make a mess when
you drop them. :-)

zhc...@gmail.com

unread,
Feb 15, 2008, 2:28:03 AM2/15/08
to Google Web Toolkit
er, Walden, thx for the replying, but what do mean by drop the
response?

if I understand correctly, GWT rpc mechanism doesn't allow RPC without
a callback, I wonder whether there is any work around.

blissteria

unread,
Feb 15, 2008, 3:37:23 AM2/15/08
to Google Web Toolkit
HI

IMHO walden meant

RequestCallback dummyCallBack = new RequestCallback(){
public void onError(Request request, Throwable exception) {
}
public void onResponseReceived(Request request, Response response)
{
}
};

rb.sendRequest("request", dummyCallBack);

walden

unread,
Feb 15, 2008, 7:59:00 AM2/15/08
to Google Web Toolkit
Yes, except that RPC calls use AsyncCallback. So just create a dummy
one of those that does like the code below.

WM
> > > > session data.- Hide quoted text -
>
> - Show quoted text -

Yves

unread,
Feb 17, 2008, 1:51:26 PM2/17/08
to Google Web Toolkit
Hi,

Just do something like that:

abstract public class AsyncCall implements AsyncCallback {
public void onFailure(Throwable t){
}
public void onSuccess(Object result) {
}
abstract public void execute();
};

then an RPC call is like :

new AsyncCall(){
public void execute(){
myapp.myfunc(this); // The RPC call, where 'this' is the
AsyncCallback that must be passed to the RPC call
}
}.execute();

Yves


On Feb 15, 1:59 pm, walden <wmath...@aladdincapital.com> wrote:
> Yes, except that RPC calls use AsyncCallback.  So just create a dummy
> one of those that does like the code below.
>
> WM
>
> On Feb 15, 3:37 am, blissteria <blisste...@hotmail.com> wrote:
>
>
>
> > HI
>
> > IMHO walden meant
>
> >                 RequestCallback dummyCallBack = new RequestCallback(){
> >                         public void onError(Request request, Throwable exception) {
> >                         }
> >                         public void onResponseReceived(Request request, Response response)
> > {
> >                         }
> >                 };
>
> >                 rb.sendRequest("request", dummyCallBack);
>
> > On 15 fév, 08:28, "zhch...@gmail.com" <zhch...@gmail.com> wrote:
>
> > > er, Walden, thx for the replying, but what do mean by drop the
> > > response?
>
> > > if I understand correctly, GWT rpc mechanism doesn't allow RPC without
> > > a callback, I wonder whether there is any work around.
>
> > > On Feb 12, 9:19 pm, walden <wmath...@aladdincapital.com> wrote:
>
> > > > Just drop the response on the floor, and no one will be the wiser.
> > > > Bits, unlike buttered andjelly'd bread, don't really make a mess when
> > > > you drop them. :-)
>
> > > > On Feb 12, 12:24 am, "zhch...@gmail.com" <zhch...@gmail.com> wrote:
>
> > > > > Hi guys,
>
> > > > > I wonder is it possible to create anRPCwithoutcallback?
>
> > > > > I imagine to use this while I am closing the window, I dont need
> > > > > server response, I simply let server know that he should clean up some
> > > > > session data.- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
Reply all
Reply to author
Forward
0 new messages