| Home | Trees | Indices | Help |
|---|
|
|
The CausalHandler is analogous to the UnorderedHandler, in that it presents an interface with which to build a wide variety of objects with distributed state. The CausalHandler is different from the Unordered in two ways:
As a convenience, there is also
CausalObjects are responsible for including index information in the return value of get_history, and processing index information in add_history.
It is noteworthy that CausalHandler is in fact implemented on _top_ of UnorderedHandler. The imposition of ordering does not require lower-level access to the network. This fact of implementation may change in the future, but CausalObjects will not be able to tell the difference.
|
|||
|
|||
|
|||
| comparable (and otherwise opaque) |
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
| CausalHandler |
|
||
| iterable(CausalHandler) |
|
||
| str |
|
||
|
|||
ZERO_INDEX = the lowest possible index associated with a message in a CausalObject. |
|||
|
|||
To construct a CausalHandler, the program must provide a name and a TubeBox. The name is used to identify the CausalObject; all CausalObjects with the same name on the same Tube should be considered views into the same abstract distributed object.
|
This method registers obj as the CausalObject being managed by this Handler. It is called by obj after obj has initialized itself.
|
get_index returns a new index, higher than all previous indexes. The primary reason to use get_index is if you wish two know the index of an item _before_ calling send()
|
index_trans is a standard serialization translator for the index format. Thanks to this translator, a CausalObject can and should treat each index as an opaque, comparable object. |
send() broadcasts a message to all other participants. If called with one argument, send() broadcasts that message, along with a new index, and returns the index. If called with two arguments, the second may be an index, which will be used for this message. The index must have been acquired using get_index(). In this case, the index must be acquired immediately prior to calling send(). Otherwise, another message may arrive in the interim, causing a violation of causality.
|
A convenience function for returning a new CausalHandler derived from this one, with a new name. This is safe as long as copy() is called with a different name every time.
|
|
|
|
|||
ZERO_INDEXthe lowest possible index associated with a message in a CausalObject. This value may be useful to implementors of CausalObjects.
|
| Home | Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0.1 on Mon Aug 17 14:53:05 2009 | http://epydoc.sourceforge.net |