Module pinger :: Class Pinger
[show private | hide private]
[frames | no frames]

Class Pinger

object --+        
         |        
  _Verbose --+    
             |    
        Thread --+
                 |
                Pinger


pings all registered satellites and kicks them when they're unreachable for too long.
Method Summary
  __init__(self, satellites, debug_method)
a new object with type S, a subtype of T __new__(S, ...)
  __repr__(self)
  __repr__(self)
(inherited from Thread)
  __str__(self)
  getName(self)
(inherited from Thread)
  halt(self)
exit the ping cycle on next tick.
  isAlive(self)
(inherited from Thread)
  isDaemon(self)
(inherited from Thread)
  join(self, timeout)
(inherited from Thread)
  ping(self, satellite)
call a satellite proxy's ping method, calculate the delay, store it in the satellite's local representation and log the delay to the server's debugfile.
  run(self)
start the ping cycle.
  setDaemon(self, daemonic)
(inherited from Thread)
  setName(self, name)
(inherited from Thread)
  start(self)
(inherited from Thread)
  _note(self, format, *args)
(inherited from _Verbose)
  _set_daemon(self)
(inherited from Thread)
  _Thread__bootstrap(self)
(inherited from Thread)
  _Thread__delete(self)
(inherited from Thread)
  _Thread__stop(self)
(inherited from Thread)

Method Details

__init__(self, satellites, debug_method)
(Constructor)

Parameters:
satellites - registered satellites.
           (type=dictionary, key=host_id, value=satellite.Satellite instance.)
debug_method - the global debug method.
           (type=method object (the global debug method).)

__new__(S, ...)

Returns:
a new object with type S, a subtype of T

halt(self)

exit the ping cycle on next tick. called on relay_registry.Co2RelayRegistry exit.

ping(self, satellite)

call a satellite proxy's ping method, calculate the delay, store it in the satellite's local representation and log the delay to the server's debugfile.
Parameters:
satellite - the satellite to ping.
           (type=a satellite.Satellite instance.)

run(self)

start the ping cycle. the thread will ping all registered satellites (starting a separate thread for each, sleep for one tick (default 1s), then check if the halt method has been called, if so, exit the loop, otherwise sleep another tick etc.

Generated by Epydoc 1.1 on Thu Oct 16 16:37:23 2003 http://epydoc.sf.net