Return value over RPC

192 views
Skip to first unread message

Adam Creeger

unread,
Apr 25, 2012, 7:18:30 PM4/25/12
to easyxdm
Hi,

I have a completely functional RPC setup using easyXDM v2.4.15, which has been working fine. However, when I try to get a return value from a synchronous RCP method call, the result is undefined. I've gone through the code, and it looks like when no callbacks are passed into an RPC call, the result is passed into an empty callback and never returned (this is in RpcBehavior._executeMethod).

If I use a callback, everything works correctly - but this is not an asynchronous operation. Are synchronous RPC calls with return values supported in the current version? If so, if you point me to the part of the source that handles it, I'll figure the rest out.

Thanks!

Adam

Øyvind Sean Kinsey

unread,
Apr 25, 2012, 7:21:28 PM4/25/12
to eas...@googlegroups.com
easyXDM (and all cross-domain messaging) do not support synchronous execution as the underlying transports are all asynchronous. So you'll have to make due with a callback..

Øyvind Sean Kinsey
San Francisco, CA

Adam Creeger

unread,
Apr 25, 2012, 8:00:02 PM4/25/12
to eas...@googlegroups.com
That's what I thought at first, but when I read http://easyxdm.net/wp/2010/03/17/remote-procedure-calls-rpc/ it seemed to imply you'd somehow magically transformed the async call to a sync call. I now understand it to mean that the local function implementation can pretend it's sync by using a return value, but even in that case, the underlying architecture uses the success callback.

Thanks as always!

Adam

2012/4/25 Øyvind Sean Kinsey <oyv...@kinsey.no>
Reply all
Reply to author
Forward
0 new messages