Module limiter :: Class Limiter
[show private | hide private]
[frames | no frames]

Class Limiter

object --+        
         |        
  _Verbose --+    
             |    
        Thread --+
                 |
                Limiter


FIFO like class for throttling co2 traffic by limiting the throughput of calls. used in both, satellite and relay.
Method Summary
  __init__(self, group, target, name, args, kwargs, verbose)
(inherited from Thread)
a new object with type S, a subtype of T __new__(S, ...)
  __repr__(self)
(inherited from Thread)
  __str__(self)
  enqueue(self, data)
append a data item to the queue.
  getName(self)
(inherited from Thread)
  halt(self)
activate the exit condition for the main loop.
  init(self, method, debug_method)
do registry-specific initilization.
  isAlive(self)
(inherited from Thread)
  isDaemon(self)
(inherited from Thread)
  join(self, timeout)
(inherited from Thread)
  pop(self)
pop the oldest item from the queue and call self.method with i as argument.
  run(self)
start the limiter cycle.
  setDaemon(self, daemonic)
(inherited from Thread)
  setName(self, name)
(inherited from Thread)
  start(self)
(inherited from Thread)

Class Variable Summary
float iv
int max_q_len

Method Details

__new__(S, ...)

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

enqueue(self, data)

append a data item to the queue.
Parameters:
data - the data to be appended.
           (type=any.)

halt(self)

activate the exit condition for the main loop. causes the thread to exit after at most Limiter.iv seconds.

init(self, method, debug_method)

do registry-specific initilization.
Parameters:
method - is called with the next item in the queue as argument (see Limiter.pop)
           (type=method object)
debug_method - the global debug method
           (type=method object)

pop(self)

pop the oldest item from the queue and call self.method with i as argument.

run(self)

start the limiter cycle.

the thread checks the queue every Limiter.iv seconds for new entries. if more than 0 are found the oldest (index 0) is popped

Class Variable Details

iv

Type:
float
Value:
0.10000000000000001                                                    

max_q_len

Type:
int
Value:
50                                                                     

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