tags:

views:

51

answers:

1

My custom callback class implements AsyncCallback (like MyAsyncCallback implements AsyncCallback) and planning use single instance of MyAsyncCallback for multiple rpc method executions. Is this approach safe?. Or should have to create new instance of MyAsyncCallback for every interaction from browser to server?.

I am kind of tired of seeing so many anonymous AsyncCallback code blocks.

Thanks for your input

+4  A: 

Does your MyAsyncCallback class contain any state?

If not, I can't think of anything that would prevent you from reusing it.

If it does... well, so far I've read that JavaScript is always single-threaded, so you should also be fine there.

Nicolas
Thanks Nicolas!.
moorsu