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

Class Engine

source code


Interface for ClusterShell engine. Subclasses have to implement a runloop listening for client events.

Instance Methods [hide private]
 
__init__(self, info)
Initialize base class.
source code
 
clients(self)
Get a copy of clients set.
source code
 
ports(self)
Get a copy of ports set.
source code
 
_fd2client(self, fd) source code
 
add(self, client)
Add a client to engine.
source code
 
_remove(self, client, did_timeout=False, force=False)
Remove a client from engine (subroutine).
source code
 
remove(self, client, did_timeout=False)
Remove a client from engine.
source code
 
clear(self, did_timeout=False, clear_ports=False)
Remove all clients.
source code
 
register(self, client)
Register an engine client.
source code
 
unregister_writer(self, client) source code
 
unregister(self, client)
Unregister a client.
source code
 
modify(self, client, setmask, clearmask)
Modify the next loop interest events bitset for a client.
source code
 
_register_specific(self, fd, event)
Engine-specific register fd for event method.
source code
 
_unregister_specific(self, fd, ev_is_set)
Engine-specific unregister fd method.
source code
 
_modify_specific(self, fd, event, setvalue)
Engine-specific modify fd for event method.
source code
 
set_events(self, client, new_events)
Set the active interest events bitset for a client.
source code
 
set_reading(self, client)
Set client reading state.
source code
 
set_reading_error(self, client)
Set client reading error state.
source code
 
set_writing(self, client)
Set client writing state.
source code
 
add_timer(self, timer)
Add engine timer.
source code
 
remove_timer(self, timer)
Remove engine timer.
source code
 
fire_timers(self)
Fire expired timers for processing.
source code
 
start_ports(self)
Start and register all port clients.
source code
 
start_all(self)
Start and register all other possible clients, in respect of task fanout.
source code
 
run(self, timeout)
Run engine in calling thread.
source code
 
snoop_ports(self)
Peek in ports for possible early pending messages.
source code
 
runloop(self, timeout)
Engine specific run loop.
source code
 
abort(self, kill)
Abort runloop.
source code
 
exited(self)
Returns True if the engine has exited the runloop once.
source code
 
_debug(self, s) source code
Class Variables [hide private]
  E_READ = 1
  E_ERROR = 2
  E_WRITE = 4
  E_ANY = 7
  identifier = '(none)'
Method Details [hide private]

add(self, client)

source code 

Add a client to engine. Subclasses that override this method should call base class method.

remove(self, client, did_timeout=False)

source code 

Remove a client from engine. Subclasses that override this method should call base class method.

clear(self, did_timeout=False, clear_ports=False)

source code 

Remove all clients. Subclasses that override this method should call base class method.

register(self, client)

source code 

Register an engine client. Subclasses that override this method should call base class method.

unregister(self, client)

source code 

Unregister a client. Subclasses that override this method should call base class method.

snoop_ports(self)

source code 

Peek in ports for possible early pending messages. This method simply tries to read port pipes in non- blocking mode.

runloop(self, timeout)

source code 

Engine specific run loop. Derived classes must implement.