Package lepl :: Package core :: Module manager :: Class _GeneratorManager
[hide private]
[frames] | no frames]

Class _GeneratorManager

source code


A 'Monitor' (implements MonitorInterface, can be supplied to Configuration) that tracks (and can limit the number of) generators.
Instance Methods [hide private]
 
__init__(self, queue_len)
queue_len is the number of generators that can exist.
source code
 
next_iteration(self, epoch, value, exception, stack)
Store the current epoch.
source code
 
push(self, generator)
Add a generator if it is not already known, or increment it's ref count.
source code
 
pop(self, generator)
Decrement a ref's count and update the epoch.
source code
 
__add(self, generator)
Add a generator, trying to keep the number of active generators to that given in the constructor.
source code
 
__add_unlimited(self, reference)
Add the new reference and discard any unused candidates that happen to be on the top of the heap.
source code
 
__add_limited(self, reference)
Add the new reference, discarding an old entry if possible.
source code

Inherited from monitor.ValueMonitor: after_next, after_send, after_throw, before_next, before_send, before_throw, exception, raise_, yield_

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, queue_len)
(Constructor)

source code 
queue_len is the number of generators that can exist. When the number is exceeded the oldest generators are closed, unless currently active (in which case the queue size is extended). If zero then no limit is applied.
Overrides: object.__init__

next_iteration(self, epoch, value, exception, stack)

source code 
Store the current epoch.
Overrides: monitor.ValueMonitor.next_iteration

push(self, generator)

source code 
Add a generator if it is not already known, or increment it's ref count.
Overrides: monitor.StackMonitor.push

pop(self, generator)

source code 
Decrement a ref's count and update the epoch.
Overrides: monitor.StackMonitor.pop