bquarp v0.1.0 Reactivity.Quality.Context View Source

Essential operations on message contexts. For every guarantee, the functions combine, penalty and transform need to be implemented. Guarantees with obvious context-progression (e.g. with counters) should implement new_context_obs.

Link to this section Summary

Functions

Combines multiple lists of contexts of possibly different consistency guarantees by combining the contexts pertaining to each occurring guarantee type separately. Takes

Creates an observable carrying the contexts for the respective values of a given observable under causality.

calculates the penalty of a context in the case of enforcing causality.

Decides whether a given context is acceptable under the given consistency guarantee.

Transforms a causality context. The transformation data is of the form {node, counter}

Link to this section Functions

Link to this function

combine(contexts, guaranteess) View Source

Combines multiple lists of contexts of possibly different consistency guarantees by combining the contexts pertaining to each occurring guarantee type separately. Takes

  • a list of context lists [[c]]]
  • a list of guarantee lists [[g]]] Returns a list of contexts [c]
Link to this function

new_context_obs(obs, arg) View Source

Creates an observable carrying the contexts for the respective values of a given observable under causality.

calculates the penalty of a context in the case of enforcing causality.

Compares paths/trees in the context two by two and takes the maximum penalty from all comparisons Two paths/trees may have a nonzero penalty if one is a prefix of the other. Then we must compare the counter produced by the last shared node in order to determine if the longer path does not reflect a later update than the prefix path, violating causality.

Link to this function

sufficient_quality?(context, arg2) View Source

Decides whether a given context is acceptable under the given consistency guarantee.

Link to this function

transform(c, trans, arg3) View Source

Transforms a causality context. The transformation data is of the form {node, counter}

If the context is a path of nodes [{node, counter}], just append the transformation data, completing the path.

If the context is a list of paths