Pyro5.client
— Client code logic
Client related classes (Proxy, mostly)
- class Pyro5.client.BatchProxy(proxy)
Proxy that lets you batch multiple method calls into one. It is constructed with a reference to the normal proxy that will carry out the batched calls. Call methods on this object that you want to batch, and finally call the batch proxy itself. That call will return a generator for the results of every method call in the batch (in sequence).
- class Pyro5.client.Proxy(uri, connected_socket=None)
Pyro proxy for a remote object. Intercepts method calls and dispatches them to the remote object.
- _pyroBind()
Bind this proxy to the exact object from the uri. That means that the proxy’s uri will be updated with a direct PYRO uri, if it isn’t one yet. If the proxy is already bound, it will not bind again.
- _pyroRelease()
release the connection to the pyro daemon
- _pyroReconnect(tries=100000000)
(Re)connect the proxy to the daemon containing the pyro object which the proxy is for. In contrast to the _pyroBind method, this one first releases the connection (if the proxy is still connected) and retries making a new connection until it succeeds or the given amount of tries ran out.
- _pyroValidateHandshake(response)
Process and validate the initial connection handshake response data received from the daemon. Simply return without error if everything is ok. Raise an exception if something is wrong and the connection should not be made.
- _pyroTimeout
The timeout in seconds for calls on this proxy. Defaults to
None
. If the timeout expires before the remote method call returns, Pyro will raise aPyro5.errors.TimeoutError
- _pyroMaxRetries
Number of retries to perform on communication calls by this proxy, allows you to override the default setting.
- _pyroSerializer
Name of the serializer to use by this proxy, allows you to override the default setting.
- _pyroHandshake
The data object that should be sent in the initial connection handshake message. Can be any serializable object.
- _pyroLocalSocket
The socket that is used locally to connect to the remote daemon. The format depends on the address family used for the connection, but usually for IPV4 connections it is the familiar (hostname, port) tuple. Consult the Python documentation on socket families for more details
- class Pyro5.client.SerializedBlob(info, data, is_blob=False)
Used to wrap some data to make Pyro pass this object transparently (it keeps the serialized payload as-is) Only when you need to access the actual client data you can deserialize on demand. This makes efficient, transparent gateways or dispatchers and such possible: they don’t have to de/reserialize the message and are independent from the serialized class definitions. You have to pass this as the only parameter to a remote method call for Pyro to understand it. Init arguments:
info
= some (small) descriptive data about the blob. Can be a simple id or name or guid. Must be marshallable.data
= the actual client data payload that you want to transfer in the blob. Can be anything that you would otherwise have used as regular remote call arguments.- deserialized()
Retrieves the client data stored in this blob. Deserializes the data automatically if required.