pub trait ControlStateDelegate: ControlStateReadAccess + ControlStateWriteAccess + Send + Sync { }
Expand description

API of the SpacetimeDB control plane.

The trait is the composition of ControlStateReadAccess and ControlStateWriteAccess to reflect the consistency model of SpacetimeDB as of this writing:

The control plane state represents the desired state of an ensemble of SpacetimeDB nodes. As such, this state can be read from a local (in-memory) representation, which is guaranteed to be “prefix consistent” across all nodes of a cluster. Prefix consistency means that the state being examined is consistent, but reads may not return the most recently written values.

As a consequence, implementations are not currently required to guarantee read-after-write consistency. In the future, however, write operations may be required to return the observed state after completing. As this may require them to suspend themselves while waiting for the writes to propagate, ControlStateWriteAccess methods are marked async today already.

Implementors§