Package groupthink :: Module groupthink_base :: Class Recentest
[hide private]
[frames] | no frames]

Class Recentest

source code

HandlerAcceptor --+
                  |
                 Recentest

Recentest is like Latest, but without using a clock or TimeHandler. As a result, it can only guarantee causality, not synchrony. However, for most users, Recentest is preferable to Latest.

Nested Classes [hide private]

Inherited from HandlerAcceptor: HANDLER_TYPE

Instance Methods [hide private]
 
__init__(self, initval, translator=<function empty_translator at 0x857b5a4>) source code
 
set_handler(self, handler)
The set_handler method accepts a Handler.
source code
 
get_value(self)
Returns the current value
source code
 
set_value(self, val)
Set a new value
source code
 
register_listener(self, L)
Register a listener L(value), to be called whenever another user adds a new latest value.
source code
 
_highscore_cb(self, val, score) source code
Method Details [hide private]

__init__(self, initval, translator=<function empty_translator at 0x857b5a4>)
(Constructor)

source code 
Parameters:
  • initval - the initial value
  • translator - the translator for the value, or the empty_translator if unspecified.

set_handler(self, handler)

source code 

The set_handler method accepts a Handler. It must cause that Handler to have its register() method called with an appropriate DObject. This can often be accomplished by simply calling another HandlerAcceptor's set_handler method.

Overrides: HandlerAcceptor.set_handler
(inherited documentation)