Opened 11 years ago

Closed 11 years ago

#6971 closed enhancement (wontfix)

dojo.rpc Events.

Reported by: guest Owned by: Dustin Machi
Priority: high Milestone: 1.2
Component: RPC Version: 1.1.1
Keywords: rpc, events Cc:
Blocked By: Blocking:

Description

It would be really nice to have some events to hook into for dojo.rpc. The two most pressing are an "onRequest" and an "onComplete" for the Xhr.

In my case, I have a largish collect of rpc functions (about 50), and some of them can take quite a bit of time to complete on the server side. I'd like to be able to use dojo.connect to notify other pieces of code when an Xhr has started and finished...

Change History (1)

comment:1 Changed 11 years ago by Dustin Machi

Resolution: wontfix
Status: newclosed

I'm not sure that I'm convinced of this. In the current rpc system (rpc services based on dojo.rpc.RpcService?), you can dojo.connect to the bind() method to know when the request (might not be xhr) has been made. Of course you'll know when it is done because the deferred is returned. However if you really want to connect to something still for the return, you can connect to svc.resultCallback and svc.errorCallback.

In dojox.rpc.Service (which will ultimately replace the current system), you can do something simlar or even implement your own transport and envelope plugins (each only a few lines of code) that emits specific events when you want.

Please reopen if there is disagreement and we can debate the merits or i can provide help if what i'm describing isn't understood.

Note: See TracTickets for help on using tickets.