Module spiroclient :: Class SpiroClient
[show private | hide private]
[frames | no frames]

Class SpiroClient


Abstracts a connection to a spiro server
Method Summary
  __init__(self, sessName, **kw)
Creates the spiro client
  __getattr__(self, attr)
performs a getattr on some remote thing
  __repr__(self)
  __setattr__(self, attr, val)
  __str__(self)
  callback(self, func)
Registers a callable as a Spiro callback and wraps it in a callback wrapper
  _allocId(self)
Allocates a unique id
  _callbackThread(self, msg)
Executes a callback, and sends back a reply, within separate thread
  _getReply(self)
Fetch the next reply thing from server
  _log(self, level, msg, nprev)
  _logException(self, level, msg)
  _readbytes(self, n)
Guaranteed to read n bytes from server, or raise exception
  _readline(self)
Reads a full line from server socket and returns it (without trailing newline)
  _rxThread(self)
Thread which receives incoming replies and callbacks.
  _sendbytes(self, buf)
Guaranteed send of all buffer, or exception
  _sendCommand(self, cmdId, cacheId, cmd, attr, *args, **kw)
  _serverCommand(self, cacheId, cmd, attr, *args, **kw)
Executes on the server

Class Variable Summary
list _badAttributes = ['__members__', '__methods__', '__getst...
str _host = '127.0.0.1'
list _localattributes = ['_client', '_name', '_objPath', '_ca...
int _port = 9091                                                                  
int _threaded = 1                                                                     
int _verbosity = 2                                                                     

Method Details

__init__(self, sessName, **kw)
(Constructor)

Creates the spiro client

Arguments:
  • sessName - name of session - allows multiple clients to share a common namespace on server.
Keywords:
  • host - hostname of spiro server
  • port - port of spiro server

__getattr__(self, attr)
(Qualification operator)

performs a getattr on some remote thing

callback(self, func)

Registers a callable as a Spiro callback and wraps it in a callback wrapper

_allocId(self)

Allocates a unique id

_callbackThread(self, msg)

Executes a callback, and sends back a reply, within separate thread

_getReply(self)

Fetch the next reply thing from server

_readbytes(self, n)

Guaranteed to read n bytes from server, or raise exception

_readline(self)

Reads a full line from server socket and returns it (without trailing newline)

_rxThread(self)

Thread which receives incoming replies and callbacks. In the case of replies, files them away in self._replyQueues

_sendbytes(self, buf)

Guaranteed send of all buffer, or exception

_serverCommand(self, cacheId, cmd, attr, *args, **kw)

Executes on the server

Class Variable Details

_badAttributes

Type:
list
Value:
['__members__', '__methods__', '__getstate__', '__getinitargs__', '__s\
lots__']                                                               

_host

Type:
str
Value:
'127.0.0.1'                                                            

_localattributes

Type:
list
Value:
['_client',
 '_name',
 '_objPath',
 '_cacheId',
 '__getinitargs__',
 '__getstate__',
 '__slots__',
 '_host',
...                                                                    

_port

Type:
int
Value:
9091                                                                  

_threaded

Type:
int
Value:
1                                                                     

_verbosity

Type:
int
Value:
2                                                                     

Generated by Epydoc 2.0 on Sun Apr 11 13:37:10 2004 http://epydoc.sf.net