Naturally these are new to 2.2 and thus no documentation has been made yet so hopefully I am asking this question fresh enough that the implementors of the networking in 2.2 still know the code they recently wrote:
I am trying to understand the behavior of the new Node.rpc() call and friends...
SomeNode.rpc("foo")
is a broadcasted message?
From what has been responded on FB this should broadcast a method call to every connected peer's /root/nodepath/to/SomeNode.foo()
(assuming SomeNode.gd declares foo with remote keyword)?
SomeNode.rpc_id(1000,"foo")
Similar to above but only generates a call to peer 1000's /root/nodepath/to/SomeNode.foo()
?
Finally, no return values? So two-way methods require providing the caller id's as arguments in eg: SomeNode.rpc_id(1,"foo",1000,arg1,arg2,...,argN)
{assume peer 1000 is asking server (1) a foo related question here} and "return" a value with self.rpc_id(1000,"foo_response",1,retval)
?
My worry here is the call/return is completely non-atomic and something affecting foo's computation could happen between foo() call on server and peer 1000 receiving foo_response().