GWT - Reusing a Callback Class

My custom callback class implements AsyncCallback (e.g. MyAsyncCallback implements AsyncCallback ), and scheduling uses a single instance of MyAsyncCallback to execute several rpc methods. Is this approach safe? Or do you need to create a new instance of MyAsyncCallback for each interaction from the browser to the server ?.

I'm tired of seeing so many anonymous AsyncCallback code blocks.

Thanks for your input.

+3
source share
1 answer

Does your class MyAsyncCallbackhave any state?

If not, I cannot think of anything that would prevent him from reusing it.

... , , JavaScript , .

+4

Source: https://habr.com/ru/post/1749581/


All Articles