Cancel Request?

803 views
Skip to first unread message

hasc...@qyotta.de

unread,
Dec 18, 2013, 5:15:36 AM12/18/13
to rest...@googlegroups.com
Hi,

first let me thank you for this project and your efforts. We are successfully using restyGWT in three project with no problem up to now! thanks!

One thing that we couldn't solve on our own is that we sometimes need to cancel a request. With the plain GWT RequestBuilder is is possible:

RequestBuilder requestBuilder = new RequestBuilder(
    RequestBuilder.GET, FOOBAR_SERVICE_URL);

Request request = requestBuilder.sendRequest("",
   new RequestCallback<ResultList>() { .... });

...

//user clicked cancel button
request.cancel();

Is this possible somehow with restyGWT too?

/cheers

   siamak

christian

unread,
Dec 18, 2013, 5:29:46 AM12/18/13
to rest...@googlegroups.com
if you use the Resource object itself you will get a Method which does the sending and there you have access to the request object used.

if you use RestService then that is not possible. BUT it looks straight forward to change the generated code (RestServiceClassCreator) to return the Method object used for sending the payload as return value of the RestService method (if the return value is declared as Method and not as void).

would that help ?

hasc...@qyotta.de

unread,
Feb 1, 2014, 9:36:16 AM2/1/14
to rest...@googlegroups.com, m.kri...@web.de
Hi Christian,

yes, that would be enough! Let me see if I can contribute the change myself. However, if your are faster then feel free to commit it.


Cheers

    Siamak

Siamak Haschemi

unread,
Feb 1, 2014, 12:45:54 PM2/1/14
to rest...@googlegroups.com, m.kri...@web.de
Hi Christian,

it seems that it is enough to let the service method return a Request-Object. On the Request-Object, I can call „cancel“. Did I miss something?


cheers

siamak

--
You received this message because you are subscribed to a topic in the Google Groups "RestyGWT" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/restygwt/9zY8rcdjDkk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to restygwt+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

-- 
Siamak Haschemi, Dipl. Inf (FH)
Geschäftsführer
 
E-Mailhasc...@qyotta.de
Mobil+49 176 64123198
 
Qyotta UG (haftungsbeschränkt)
Pannierstraße 40
12047 Berlin
http://www.qyotta.de
 
Geschäftsführer: Siamak Haschemi, Martin Schmidt
Handelsregister: Amtsgericht Berlin-Charlottenburg HRB 138181 B
USt-ID: DE280887719, Finanzamt für Körperschaften I, Berlin-Charlottenburg
 
Diese Nachricht (inklusive aller Anhänge) ist vertraulich. Sie darf ausschließlich durch den vorgesehenen Empfänger und Adressaten gelesen, kopiert oder genutzt werden. Sollten Sie diese Nachricht versehentlich erhalten haben, bitten wir, den Absender (durch Antwort-E-Mail) hiervon unverzüglich zu informieren und die Nachricht zu löschen. Jede unerlaubte Nutzung oder Weitergabe des Inhalts dieser Nachricht, sei es vollständig oder teilweise, ist unzulässig. Bitte beachten Sie, dass E-Mail-Nachrichten an den Absender nicht für fristgebundene Mitteilungen geeignet sind. Fristgebundene Mitteilungen sind daher ausschließlich per Post oder per Telefax zu übersenden.
 
This message (including any attachments) is confidential and may be privileged. It may be read, copied and used only by the intended recipient. If you have received it in error please contact the sender (by return E-Mail) immediately and delete this message. Any unauthorised use or dissemination of this message in whole or in part is strictly prohibited. Please note that, for organisational reasons, the personal E-Mail address of the sender is not available for matters subject to a deadline. Please send, therefore, matters subject to deadline exclusively by mail or by fax.






christian

unread,
Feb 1, 2014, 12:53:43 PM2/1/14
to rest...@googlegroups.com, kristian
that is OK. the only thing is that we need to stay backward compatible,
i.e. if the method in RestService interface declares void that the
generated implementation should not return anything. if the method
returns Request then the generated code should just return that.

- christian


--
You received this message because you are subscribed to the Google Groups "RestyGWT" group.
To unsubscribe from this group and stop receiving emails from it, send an email to restygwt+u...@googlegroups.com.

Siamak Haschemi

unread,
Feb 1, 2014, 12:54:28 PM2/1/14
to Christian Meier, rest...@googlegroups.com
Hi Christian,

sorry for not being exact, it seems like the mentionen Java-Class ALREADY does that. I cloned the git-repo and saw that it is possible to use JsonpRequest and Request.


cheers

Siamak

Am 01.02.2014 um 18:52 schrieb Christian Meier <chri...@mykolab.com>:



On 01/02/14 17:45, Siamak Haschemi wrote:
Hi Christian,

it seems that it is enough to let the service method return a Request-Object. On the Request-Object, I can call „cancel“. Did I miss something?

that is OK. the only thing is that we need to stay backward compatible,
i.e. if the method in RestService interface declares void that the
generated implementation should not return anything. if the method
returns Request then the generated code should just return that.

- christian

christian

unread,
Feb 1, 2014, 1:02:57 PM2/1/14
to rest...@googlegroups.com, Christian Meier
hey cool, I did not know that ;)

so you can just use it . . . .

- christian




--
You received this message because you are subscribed to the Google Groups "RestyGWT" group.
To unsubscribe from this group and stop receiving emails from it, send an email to restygwt+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages