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

Class EnginePort

source code


An EnginePort is an abstraction object to deliver messages reliably between tasks.

Nested Classes [hide private]
  _Msg
Private class representing a port message.
Instance Methods [hide private]
 
__init__(self, task, handler=None, autoclose=False)
Initialize EnginePort object.
source code
 
__repr__(self) source code
 
_start(self)
Start port.
source code
 
_close(self, abort, timeout)
Close port.
source code
 
_handle_read(self, sname)
Handle a read notification.
source code
 
msg(self, send_msg, send_once=False)
Port message send method that will wait for acknowledgement unless the send_once parameter if set.
source code
 
msg_send(self, send_msg)
Port message send-once method (no acknowledgement).
source code

Inherited from EngineClient: abort

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

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

Method Details [hide private]

__init__(self, task, handler=None, autoclose=False)
(Constructor)

source code 

Initialize EnginePort object.

Overrides: Engine.Engine.EngineBaseTimer.__init__

__repr__(self)
(Representation operator)

source code 
Overrides: EngineClient.__repr__

_start(self)

source code 

Start port.

Overrides: EngineClient._start

_close(self, abort, timeout)

source code 

Close port.

Overrides: EngineClient._close

_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.

Overrides: EngineClient._handle_read

msg(self, send_msg, send_once=False)

source code 

Port message send method that will wait for acknowledgement unless the send_once parameter if set.

May be called from another thread. Will generate ev_msg() on Port event handler (in Port task/thread).

Return False if the message cannot be sent (eg. port closed).

msg_send(self, send_msg)

source code 

Port message send-once method (no acknowledgement). See msg().

Return False if the message cannot be sent (eg. port closed).