Package gmisclib :: Module spread_jobs :: Class Connection
[frames] | no frames]

Class Connection

source code


This class represents a connection from the master process down to one of the slaves. It also keeps track of how often the slave reports that it is too busy to work.

Instance Methods
 
__init__(self, arglist)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
send(self, todo) source code
 
get(self)
Returns: (answer, standard_output, standard_error) or None.
source code
 
close(self)
Closes the channel to the slave.
source code
list(str)
wait(self)
Waits for the slave to terminate and closes the channel from the slave.
source code
 
argstring(self) source code
 
usefulness(self) source code
 
I_am_working(self, now) source code
 
mystate(self, state) source code
 
performance(self) source code

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

Class Variables
  BUSYFAC1 = 0.85
  BUSYFAC2 = 0.15
  ConnectError = ()
  SendError = (<type 'exceptions.IOError'>, <type 'exceptions.Va...
  GetError = (<type 'exceptions.EOFError'>)
Instance Variables
  uness
How useful is this thread?
Properties

Inherited from object: __class__

Method Details

__init__(self, arglist)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • arglist (a sequence of anything that can be converted to strings.) - an argument list to execute to start a subprocess.
Raises:
  • OSError - when connection cannot be set up.
Overrides: object.__init__

Note: This is where the arglist is finally converted to a list of strings.

send(self, todo)

source code 
Raises:
  • IOError - Trouble sending.

get(self)

source code 
Returns:
(answer, standard_output, standard_error) or None.
Raises:
  • EOFError - No data available from slave.

wait(self)

source code 

Waits for the slave to terminate and closes the channel from the slave.

Returns: list(str)
any final output.

Class Variable Details

SendError

Value:
(<type 'exceptions.IOError'>, <type 'exceptions.ValueError'>)