| |
- Pyro.core.ObjBase
-
- RemoteObject
- NameServer
- Watcher
class NameServer |
|
the NameServer object represents the name server running
on a remote host and provides methods for interacting with it |
|
Methods defined here:
- __init__(self, ns_host='ece.olin.edu')
- locate the name server on the given host
- clear(self, prefix='', group=None)
- unregister all objects in the given group that start
with the given prefix
- create_group(self, name)
- create a group with the given name
- get_proxy(self, name)
- look up a remote object by name and create a proxy for it
- get_remote_object_list(self, prefix='', group=None)
- return a list of the remote objects in the given group
that start with the given prefix
- query(self, name, group=None)
- check whether the given name is registered in the given group.
return 1 if the name is a remote object, 0 if it is a group,
and -1 if it doesn't exist.
|
class RemoteObject(Pyro.core.ObjBase) |
|
objects that want to be available remotely should inherit
from this class, and either (1) don't override __init__ or
(2) call RemoteObject.__init__ explicitly |
|
Methods defined here:
- __init__(self)
- cleanup(self)
- remove this object from the name server
- connect(self, ns, name=None)
- connect to the given name server with the given name;
if a name is not provided, one will be assigned.
- join(self)
- wait for the threadLoop to complete
- requestLoop(self)
- run the request loop until an exception occurs
- stopLoop(self)
- if threadLoop is running, stop it
- stoppableLoop(self)
- run handleRequests until another thread clears self.running
- threadLoop(self)
- run the request loop in a separate thread
Methods inherited from Pyro.core.ObjBase:
- GUID(self)
- Pyro_dyncall(self, method, flags, args)
- delegateTo(self, delegate)
- getAttrProxy(self)
- getDaemon(self)
- getLocalStorage(self)
- getProxy(self)
- remote_retrieve_code(self, name)
- # remote code retrieve support (client retrieves from server):
- remote_supply_code(self, name, module, sourceaddr)
- # remote code downloading support (server downloads from client):
- setCodeValidator(self, v)
- setDaemon(self, daemon)
- setGUID(self, guid)
|
class Watcher |
|
this class solves two problems with multithreaded
programs in Python, (1) a signal might be delivered
to any thread (which is just a malfeature) and (2) if
the thread that gets the signal is waiting, the signal
is ignored (which is a bug).
The watcher is a concurrent process (not thread) that
waits for a signal and the process that contains the
threads. See Appendix A of The Little Book of Semaphores.
I have only tested this on Linux. I would expect it to
work on OS X and not work on Windows. |
|
Methods defined here:
- __init__(self, callback=None)
- Creates a child thread, which returns. The parent
thread waits for a KeyboardInterrupt and then kills
the child thread.
- kill(self)
- watch(self, callback=None)
| |