Package SPyRO :: Module SPyRO
[show private | hide private]
[frames | no frames]

Module SPyRO.SPyRO

Simple Python Remote Objects Implements Simple Remote Objects (attributes and methods).

Provides the complete suite: server and client services, and RemoteObject wrappers to objects.

Implement new formats are quite simple. Just create a class or module with the methods or functions loads and dumps and register your interface with the |registerFormat| function. Thread safe operation is responsibility of the new add-on.

Important Note: Since SPyRO |Server| is multithreaded, but |PeerConnection| had synchronous protocol, it will not be able to manage many request (every action over a object is a request) on the same connection. It is necessary use a |Client| object peer concurrent thread, in the best case, may be one or two are necessary or use |TClient| (uses a pool of |Client|'s transparentely).
Classes
Client A Client to CommunicationServer.
CodePool Register python modules and executes functions in modules.
CommClientMixIn The mixin to CommunicationClient{,Threaded}
CommunicationClient A Client to CommunicationServer.
CommunicationClientBase A base class to any CommunicationServer client.
CommunicationClientThreaded The thread safe CommunicationClient.
CommunicationServer Starts a standalone SPyRO Server
CommunicationServerBase The base of spyro's communication servers
CommunicationServerShared  
FakeIterator FakeIterator
ItemCodePool  
PeerConnection Connect to Remote Host and create a channel to communicate This object must be used in a synchronous way
ProtocolHTTPReader Protocol used by clients, it runs under HTTP transmition layer
ProtocolHTTPShared An HTTP Server to manage SPyRO requests, attached to another HTTP server
RemoteObject Local representation of a RemoteObject.
Request Object to request to the remote object server
Response Objects to send as response at requests.
Server Starts a standalone SPyRO Server
ServerObjectPool The pool of objects interface.
ServerShared  
TClient The thread safe CommunicationClient.
TransportProtocolMixIn Common methods in the ProtocolHTTP* server and clients

Exceptions
AttributeIsCallable  
RemoteException  

Function Summary
  default_socket_error_handler(comm, _socket, addr, error)
The default, fool, error handler in Client connections
  getconn(remoteobject)
Return the connection of the remote object
  getobject(address, location, name, local_server, poolSize)
Can be used as a shortcut when only we need one object in address
  getobjname(remoteobject)
Returns the name of the object
  newRequestBye()
Creates a new Request for a 'YE object operation
  newRequestCall(objname, attrname, args, kwargs, rettype, local_server, auth, extra)
A SPyRO request, call mode |objname| Object name |attrname| The methodname |args| Positional arguments, tuple |kwargs| Keyword arguments, dictionary |rettype| The return type, SendByReference or SendByValue |local_server| If Request to call a remote method and exists port we call the method with the pass the arguments by reference the server receives the name or id in the remote peer (the caller) and a port to connect.
  newRequestDel(objname, auth)
Creates a new Request for a DEL object operation
  newRequestGet(objname, attrname, rettype, auth)
Creates a new Request for a |getattr| operation
  newRequestSet(objname, attrname, value, local_server, auth)
Creates a new Request for a |setattr| operation, to set the attrname to value
  newResponse(errcode, retvalue, rettype)
Create and returns a server side response from the arguments
  ObjectWrapper_ByReference(xobject, xserver, xauthority)
Wrap objects to send objects to Reference
  ObjectWrapper_ByValue(xobject)
Wrap objects to send objects to Reference
  ObjectWrapper_GetObject(objarg)
  ObjectWrapper_GetType(objarg)
  ObjectWrapper_GuessType(xobject, xserver)
Function to wrap object guessing the more convenient type to send (send by reference or by value)
  ObjectWrapper_Unpack(objarg)
  _set_booleans()

Function Details

default_socket_error_handler(comm, _socket, addr, error)

The default, fool, error handler in Client connections

getconn(remoteobject)

Return the connection of the remote object

getobject(address, location, name, local_server=None, poolSize=0)

Can be used as a shortcut when only we need one object in address

getobjname(remoteobject)

Returns the name of the object

newRequestBye()

Creates a new Request for a 'YE object operation

newRequestCall(objname, attrname, args, kwargs, rettype, local_server, auth, extra)

A SPyRO request, call mode |objname| Object name |attrname| The methodname |args| Positional arguments, tuple |kwargs| Keyword arguments, dictionary |rettype| The return type, SendByReference or SendByValue |local_server| If Request to call a remote method and exists port we call the method with the pass the arguments by reference the server receives the name or id in the remote peer (the caller) and a port to connect. The IP address is obtained by the socket |auth| The authentication object |extra| Additional info to append to message, for example routed calls

newRequestDel(objname, auth)

Creates a new Request for a DEL object operation

newRequestGet(objname, attrname, rettype, auth)

Creates a new Request for a |getattr| operation

newRequestSet(objname, attrname, value, local_server, auth)

Creates a new Request for a |setattr| operation, to set the attrname to value

newResponse(errcode, retvalue, rettype)

Create and returns a server side response from the arguments

ObjectWrapper_ByReference(xobject, xserver, xauthority=None)

Wrap objects to send objects to Reference

ObjectWrapper_ByValue(xobject)

Wrap objects to send objects to Reference

ObjectWrapper_GuessType(xobject, xserver)

Function to wrap object guessing the more convenient type to send (send by reference or by value)

Generated by Epydoc 2.1 on Sat Oct 14 11:50:52 2006 http://epydoc.sf.net