Package ClusterShell :: Package Worker :: Module EngineClient :: Class EngineClient
[hide private]
[frames] | no frames]

Class EngineClient

source code


Abstract class EngineClient.

Instance Methods [hide private]
 
__init__(self, worker, key, stderr, timeout, autoclose)
EngineClient initializer.
source code
 
__repr__(self) source code
 
_fire(self)
Fire timeout timer.
source code
 
_start(self)
Starts client and returns client instance as a convenience.
source code
 
_close(self, abort, timeout)
Close client.
source code
 
_close_stream(self, sname)
Close specific stream by name (internal, called by engine).
source code
 
_set_reading(self, sname)
Set reading state.
source code
 
_set_writing(self, sname)
Set writing state.
source code
 
_read(self, sname, size=65536)
Read data from process.
source code
 
_flush_read(self, sname)
Called when stream is closing to flush read buffers.
source code
 
_handle_read(self, sname)
Handle a read notification.
source code
 
_handle_write(self, sname)
Handle a write notification.
source code
 
_exec_nonblock(self, commandlist, shell=False, env=None)
Utility method to launch a command with stdin/stdout file descriptors configured in non-blocking mode.
source code
 
_readlines(self, sname)
Utility method to read client lines.
source code
 
_write(self, sname, buf)
Add some data to be written to the client.
source code
 
_set_write_eof(self, sname)
Set EOF on specific writable stream.
source code
 
abort(self)
Abort processing any action by this client.
source code

Inherited from Engine.Engine.EngineBaseTimer: invalidate, is_valid, set_nextfire

Inherited from Engine.Engine.EngineBaseTimer (private): _set_engine

Method Details [hide private]

__init__(self, worker, key, stderr, timeout, autoclose)
(Constructor)

source code 
EngineClient initializer.

Should be called from derived classes.

Arguments:
    worker -- parent worker instance
    key -- client key used by MsgTree (eg. node name)
    stderr -- boolean set if stderr is on a separate stream
    timeout -- client execution timeout value (float)
    autoclose -- boolean set to indicate whether this engine
                 client should be aborted as soon as all other
                 non-autoclosing clients have finished.

Overrides: Engine.Engine.EngineBaseTimer.__init__

_fire(self)

source code 

Fire timeout timer.

Overrides: Engine.Engine.EngineBaseTimer._fire

_start(self)

source code 

Starts client and returns client instance as a convenience. Derived classes (except EnginePort) must implement.

_close(self, abort, timeout)

source code 

Close client. Called by the engine after client has been unregistered. This method should handle both termination types (normal or aborted) and should set timeout status accordingly.

Derived classes should implement.

_close_stream(self, sname)

source code 

Close specific stream by name (internal, called by engine). This method is the regular way to close a stream flushing read buffers accordingly.

_handle_read(self, sname)

source code 

Handle a read notification. Called by the engine as the result of an event indicating that a read is available.

_handle_write(self, sname)

source code 

Handle a write notification. Called by the engine as the result of an event indicating that a write can be performed now.