Package SpecClient :: Module SpecConnectionsManager :: Class _ThreadedSpecConnectionsManager
[hide private]
[frames] | no frames]

Class _ThreadedSpecConnectionsManager

source code

        object --+        
                 |        
threading._Verbose --+    
                     |    
      threading.Thread --+
                         |
                        _ThreadedSpecConnectionsManager

Class for managing connections to Spec

Polling of asynchronous socket events is delegated to a separate thread

Warning: should never be instanciated directly ; use the module level SpecConnectionsManager() function instead.

Instance Methods [hide private]
 
__init__(self, dispatch_events)
Constructor
source code
 
run(self)
Override Thread.run() ; define behaviour for the connections manager thread
source code
 
stop(self)
Stop the connections manager thread and dereferences all connections
source code
 
getConnection(self, specVersion)
Return a SpecConnection object
source code
 
closeConnection(self, specVersion) source code
 
closeConnections(self) source code

Inherited from threading.Thread: __repr__, getName, isAlive, isDaemon, is_alive, join, setDaemon, setName, start

Inherited from threading.Thread (private): _reset_internal_locks, _set_daemon, _set_ident

Inherited from threading._Verbose (private): _note

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from threading.Thread: daemon, ident, name

Inherited from threading.Thread (private): _block

Inherited from object: __class__

Method Details [hide private]

__init__(self, dispatch_events)
(Constructor)

source code 

Constructor

Overrides: object.__init__

run(self)

source code 

Override Thread.run() ; define behaviour for the connections manager thread

For each SpecConnection object in the connections dictionary, try to make a connection. If the connection is already established, nothing occurs. Poll the asyncore dispatchers for processing socket events.

Overrides: threading.Thread.run

getConnection(self, specVersion)

source code 

Return a SpecConnection object

Arguments: specVersion -- a string in the 'host:port' form