Package ClusterShell :: Module Communication :: Class Channel
[hide private]
[frames] | no frames]

Class Channel

source code


Use this event handler to establish a communication channel between to
hosts whithin the propagation tree.

The endpoint's logic has to be implemented by subclassing the Channel class
and overriding the start() and recv() methods.

There is no default behavior for these methods apart raising a
NotImplementedError.

Usage:
  >> chan = MyChannel() # inherits Channel
  >> task = task_self()
  >> task.shell("uname -a", node="host2", handler=chan)
  >> task.resume()

Instance Methods [hide private]
 
__init__(self, error_response=False)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
_init(self)
start xml document for communication
source code
 
_open(self)
open a new communication channel from src to dst
source code
 
_close(self)
close an already opened channel
source code
 
ev_start(self, worker)
connection established.
source code
 
ev_read(self, worker)
channel has data to read
source code
 
send(self, msg)
write an outgoing message as its XML representation
source code
 
start(self)
initialization logic
source code
 
recv(self, msg)
callback: process incoming message
source code

Inherited from Event.EventHandler: ev_close, ev_error, ev_hup, ev_msg, ev_pickup, ev_timeout, ev_timer, ev_written

Inherited from Event.EventHandler (private): _ev_routing

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

Class Variables [hide private]
  SNAME_WRITER = 'ch-writer'
  SNAME_READER = 'ch-reader'
  SNAME_ERROR = 'ch-error'
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, error_response=False)
(Constructor)

source code 

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

Overrides: object.__init__

ev_start(self, worker)

source code 

connection established. Open higher level channel

Overrides: Event.EventHandler.ev_start

ev_read(self, worker)

source code 

channel has data to read

Overrides: Event.EventHandler.ev_read