RMI¶
The BNDL RMI module builds on bndl.net to allow for Remote Method Invocations.
The implementation is rather straight forward: RMIPeerNode provides is the means to send
and receive Request and Response Methods. Requests are targeting a method of the remote node by
name. It is simply looked up by getattr.
-
class
bndl.rmi.node.RMINode(name=None, addresses=None, seeds=None, loop=None)[source]¶ Bases:
bndl.net.node.NodeA
bndl.net.Nodewhich expects it’s peers to support remote method invocation as implemented inRMIPeerNode.
-
class
bndl.rmi.node.Invocation(peer, name)[source]¶ Bases:
objectInvocation of a method on a PeerNode.
Messages¶
Exceptions¶
-
exception
bndl.rmi.exceptions.InvocationException[source]¶ Bases:
ExceptionException indicating a RMI failed. This exception is ‘raised from’ a ‘reconstructed’ exception as raised in the remote method
-
bndl.rmi.exceptions.root_exc(exc)[source]¶ Returns the __cause__ of exc if exc is an InvocationException or just exc otherwise.
Can be used when both local and remote exceptions need to be handled and their semantics are the same (whether the exception was raised locally or on a remote worker doesn’t matter).
Parameters: exc – The exception which _might_ be an InvocationException