Interface IDeltaReplicatedData<T, TDelta>
IReplicatedData<T> with additional support for delta-CRDT replication. delta-CRDT is a way to reduce the need for sending the full state for updates. For example adding element 'c' and 'd' to set {'a', 'b'} would result in sending the delta {'c', 'd'} and merge that with the state on the receiving side, resulting in set {'a', 'b', 'c', 'd'}.
Learn more about this in the paper Delta State Replicated Data Types.
Inherited Members
Namespace: Akka.DistributedData
Assembly: Akka.DistributedData.dll
Syntax
public interface IDeltaReplicatedData<T, TDelta> : IDeltaReplicatedData, IReplicatedData<T>, IReplicatedData where T : IReplicatedData where TDelta : IReplicatedDelta
Type Parameters
Name | Description |
---|---|
T | Replicated data type |
TDelta | The type of the delta. To be specified by subclass. It may be the same type as |
Properties
| Improve this Doc View SourceDelta
The accumulated delta of mutator operations since previous
ResetDelta(). When the Akka.DistributedData.Replicator invokes the modify
function
of the Update message and the user code is invoking one or more mutator
operations the data is collecting the delta of the operations and makes
it available for the Akka.DistributedData.Replicator with the Delta accessor. The
modify
function shall still return the full state in the same way as
IReplicatedData<T> without support for deltas.
Declaration
TDelta Delta { get; }
Property Value
Type | Description |
---|---|
TDelta |
Methods
| Improve this Doc View SourceMergeDelta(TDelta)
When delta is merged into the full state this method is used.
When the type TDelta
of the delta is of the same type as the full
state T
this method can be implemented by delegating to
Merge(T).
Declaration
T MergeDelta(TDelta delta)
Parameters
Type | Name | Description |
---|---|---|
TDelta | delta |
Returns
Type | Description |
---|---|
T |
ResetDelta()
Reset collection of deltas from mutator operations. When the Akka.DistributedData.Replicator
invokes the modify
function of the Update message the delta is always
"reset" and when the user code is invoking one or more mutator operations the
data is collecting the delta of the operations and makes it available for
the Akka.DistributedData.Replicator with the Delta accessor. When the
Akka.DistributedData.Replicator has grabbed the Delta it will invoke this method
to get a clean data instance without the delta.
Declaration
T ResetDelta()
Returns
Type | Description |
---|---|
T |