Core logic (uri, daemon, proxy stuff).
Pyro object URI (universal resource identifier). The uri format is like this: PYRO:objectid@location where location is one of:
the string representation of this object
determine if a location string is for a Unix domain socket
property containing the location string, for instance "servername.you.com:5555"
Pyro daemon. Contains server side logic and dispatches incoming remote method calls to the appropriate objects.
Close down the server and release resources
for use in an external event loop: handle any requests that are pending for this daemon
Handle incoming Pyro request. Catches any exception that may occur and wraps it in a reply to the calling side, as to not make this server side loop terminate due to exceptions caused by remote invocations.
The location (str of the form host:portnumber) on which the Daemon is listening
The NAT-location (str of the form nathost:natportnumber) on which the Daemon is exposed for use with NAT-routing
Dictionary from Pyro object id to the actual Pyro object registered by this id
Register a Pyro object under the given id. Note that this object is now only known inside this daemon, it is not automatically available in a name server. This method returns a URI for the registered object.
Goes in a loop to service incoming requests, until someone breaks this or calls shutdown from another thread.
Very basic method to fire up a daemon (or supply one yourself). objects is a dict containing objects to register as keys, and their names (or None) as values. If ns is true they will be registered in the naming server as well, otherwise they just stay local.
Cleanly terminate a daemon that is running in the requestloop. It must be running in a different thread, or this method will deadlock.
Remove an object from the known objects inside this daemon. You can unregister an object directly or with its id.
Get a URI for the given object (or object id) from this daemon. Only a daemon can hand out proper uris because the access location is contained in them. Note that unregistered objects cannot be given an uri, but unregistered object names can (it’s just a string we’re creating in that case). If nat is set to False, the configured NAT address (if any) is ignored and it will return an URI for the internal address.
The part of the daemon that is exposed as a Pyro object.
a simple do-nothing method for testing purposes
returns a list of all object names registered in this daemon
decorator to mark a method to be a ‘callback’. This will make Pyro raise any errors also on the callback side, and not only on the side that does the callback call.
convenience method to get a batch proxy adapter
convenience method to get an async proxy adapter
Pyro proxy for a remote object. Intercepts method calls and dispatches them to the remote object.
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.
release the connection to the pyro daemon
(re)connect the proxy to the daemon containing the pyro object which the proxy is for
returns a helper class that lets you create batched method calls on the proxy
returns a helper class that lets you do asynchronous method calls on the proxy
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 a Pyro4.errors.TimeoutError.
A set of attribute names to be called as one-way method calls. This means the client won’t wait for a response from the server while it is processing the call. Their return value is always None.