Class Dsl
A helper class used to simplify creation of messages send through the Akka.DistributedData.Replicator.
Inherited Members
Namespace: Akka.DistributedData
Assembly: Akka.DistributedData.dll
Syntax
public static class Dsl
Properties
| Improve this Doc View SourceGetKeyIds
Constructs a message that, when send to Replicator, will be replied with GetKeysIdsResult message having a list of keys for all replicated data structures stored on the current node.
Declaration
public static GetKeyIds GetKeyIds { get; }
Property Value
Type | Description |
---|---|
GetKeyIds |
GetReplicaCount
Constructs a message that, when send to Replicator, will be replied with ReplicaCount message having a number of all replicas known to the current node.
Declaration
public static GetReplicaCount GetReplicaCount { get; }
Property Value
Type | Description |
---|---|
GetReplicaCount |
ReadLocal
Gets a IReadConsistency setup, which will acknowledge success of a Get<T>(IKey<T>, IReadConsistency, Object) operation immediately as soon, as result will be confirmed by the local replica only.
Declaration
public static ReadLocal ReadLocal { get; }
Property Value
Type | Description |
---|---|
ReadLocal |
WriteLocal
Gets a IWriteConsistency setup, which will acknowledge success of an Update or Delete<T>(IKey<T>, IWriteConsistency, Object) operation immediately as soon, as result will be confirmed by the local replica only.
Declaration
public static WriteLocal WriteLocal { get; }
Property Value
Type | Description |
---|---|
WriteLocal |
Methods
| Improve this Doc View SourceDelete<T>(IKey<T>, IWriteConsistency, Object)
Constructs a message that, when send to Replicator,
will perform a delete of a structure stored under provided key
,
and reply with IDeleteResponse message.
A delete is irrecoverable - you cannot reinsert a value under the key that has been deleted. If you try, a DataDeleted response will be send back.
A deletion doesn't clear all of the memory used by the store. Some portion of it is used to keep track of deleted records across the nodes.
Declaration
public static Delete Delete<T>(IKey<T> key, IWriteConsistency consistency, object request = null)
where T : IReplicatedData
Parameters
Type | Name | Description |
---|---|---|
IKey<T> | key | Key, for which a value should be retrieved. |
IWriteConsistency | consistency | A consistency level determining when/how response will be retrieved. |
Object | request | An object added to both generated Get request and IGetResponse. Can be used i.e. as correlation id. |
Returns
Type | Description |
---|---|
Delete | TBD |
Type Parameters
Name | Description |
---|---|
T | Replicated data type. |
Get<T>(IKey<T>, IReadConsistency, Object)
Constructs a message that, when send to Replicator,
will perform a retrieve of a data structure stored under provided key
,
and reply with IGetResponse message.
An optional consistency
level may be supplied in order to apply
certain constraints on the produced response.
Declaration
public static Get Get<T>(IKey<T> key, IReadConsistency consistency = null, object request = null)
where T : IReplicatedData
Parameters
Type | Name | Description |
---|---|---|
IKey<T> | key | Key, for which a value should be retrieved. |
IReadConsistency | consistency | A consistency level determining when/how response will be retrieved. |
Object | request | An object added to both generated Get request and IGetResponse. Can be used i.e. as correlation id. |
Returns
Type | Description |
---|---|
Get | TBD |
Type Parameters
Name | Description |
---|---|
T | Replicated data type. |
Subscribe<T>(IKey<T>, IActorRef)
Constructs a message that, when send to Replicator,
will perform a subscription of provided subscriber
actor to any
changes performed on the provided key
.
All changes will be send in form of a Changed message to the
subscriber
.
Declaration
public static Subscribe Subscribe<T>(IKey<T> key, IActorRef subscriber)
where T : IReplicatedData
Parameters
Type | Name | Description |
---|---|---|
IKey<T> | key | Key used to subscribe an actor to all changes occurring in correlated data structure. |
IActorRef | subscriber | Actor subscribing to changes under provided |
Returns
Type | Description |
---|---|
Subscribe | TBD |
Type Parameters
Name | Description |
---|---|
T | Replicated data type. |
Unsubscribe<T>(IKey<T>, IActorRef)
Constructs a message that, when send to Replicator,
will perform a unsubscription of provided subscriber
actor from
list of provided key
subscriptions.
Declaration
public static Unsubscribe Unsubscribe<T>(IKey<T> key, IActorRef subscriber)
where T : IReplicatedData
Parameters
Type | Name | Description |
---|---|---|
IKey<T> | key | Key, to which a |
IActorRef | subscriber | A subscriber for the |
Returns
Type | Description |
---|---|
Unsubscribe | TBD |
Type Parameters
Name | Description |
---|---|
T | Replicated data type. |
Update<T>(IKey<T>, T, IWriteConsistency)
Constructs a message that, when send to Replicator,
will perform an update of a structure stored under provided key
.
If a value
will differ from the one already stored, a merge
operation will be automatically performed in order for those values to converge.
An optional consistency
level may be provided to set up certain
constraints on retrieved IUpdateResponse replied from replicator as
a result. If no consistency
will be provided, a WriteLocal
will be used as a default.
Declaration
public static Update Update<T>(IKey<T> key, T value, IWriteConsistency consistency = null)
where T : IReplicatedData<T>
Parameters
Type | Name | Description |
---|---|---|
IKey<T> | key | Key under which a replicated |
T | value | Replicated data structure to be updated. |
IWriteConsistency | consistency | Consistency determining how/when response will be emitted. |
Returns
Type | Description |
---|---|
Update |
Type Parameters
Name | Description |
---|---|
T | Replicated data type. |
Update<T>(IKey<T>, T, IWriteConsistency, Func<T, T>)
Constructs a message that, when send to Replicator,
will perform an update of a structure stored under provided key
.
Update operation is described by modify
function, that will take
a previous value as an input parameter. If no value was found under the key
,
an initial
value will be used instead.
An consistency
level may be provided to set up certain constraints
on retrieved IUpdateResponse replied from replicator as a result.
Declaration
public static Update Update<T>(IKey<T> key, T initial, IWriteConsistency consistency, Func<T, T> modify)
where T : IReplicatedData
Parameters
Type | Name | Description |
---|---|---|
IKey<T> | key | Key under which a value should be updated. |
T | initial | Initial value used, when no value has been stored under the provided |
IWriteConsistency | consistency | Consistency determining how/when response will be emitted. |
Func<T, T> | modify | An updating function. |
Returns
Type | Description |
---|---|
Update | TBD |
Type Parameters
Name | Description |
---|---|
T | Replicated data type. |
Update<T>(IKey<T>, T, IWriteConsistency, Object, Func<T, T>)
Constructs a message that, when send to Replicator,
will perform an update of a structure stored under provided key
.
Update operation is described by modify
function, that will take
a previous value as an input parameter. If no value was found under the key
,
an initial
value will be used instead.
An consistency
level may be provided to set up certain constraints
on retrieved IUpdateResponse replied from replicator as a result.
Declaration
public static Update Update<T>(IKey<T> key, T initial, IWriteConsistency consistency, object request, Func<T, T> modify)
where T : IReplicatedData
Parameters
Type | Name | Description |
---|---|---|
IKey<T> | key | Key under which a value should be updated. |
T | initial | Initial value used, when no value has been stored under the provided |
IWriteConsistency | consistency | Consistency determining how/when response will be emitted. |
Object | request | An object added to both generated Update request and IUpdateResponse. Can be used i.e. as correlation id. |
Func<T, T> | modify | An updating function. |
Returns
Type | Description |
---|---|
Update | TBD |
Type Parameters
Name | Description |
---|---|
T | Replicated data type. |
Update<T>(IKey<T>, IWriteConsistency, Func<T, T>)
Constructs a message that, when send to Replicator,
will perform an update of a structure stored under provided key
.
Update operation is described by modify
function, that will take
a previous value as an input parameter.
An consistency
level may be provided to set up certain constraints
on retrieved IUpdateResponse replied from replicator as a result.
Declaration
public static Update Update<T>(IKey<T> key, IWriteConsistency consistency, Func<T, T> modify)
where T : IReplicatedData
Parameters
Type | Name | Description |
---|---|---|
IKey<T> | key | Key under which a value should be updated. |
IWriteConsistency | consistency | Consistency determining how/when response will be emitted. |
Func<T, T> | modify | An updating function. |
Returns
Type | Description |
---|---|
Update | TBD |
Type Parameters
Name | Description |
---|---|
T | Replicated data type. |