Interface IReceiverState
Interface for data structures used for tracking delivery state.
Namespace:Akka.Persistence.Extras
Assembly:Akka.Persistence.Extras.dll
Syntax
public interface IReceiverState
Properties
Ordering
The ordering expected by the DeDuplicatingReceiveActor.
Declaration
ReceiveOrdering Ordering { get; }
Property Value
| Type | Description |
|---|---|
| ReceiveOrdering |
TrackedSenders
Returns the set of current senders by their IDs and the last time we processed a message sent from them.
Declaration
IReadOnlyDictionary<string, DateTime> TrackedSenders { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyDictionary<System.String, DateTime> |
Methods
AlreadyProcessed(Int64, String)
Check to see if this message has already been processed or not.
Declaration
bool AlreadyProcessed(long confirmationId, string senderId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int64 | confirmationId | The correlation id for this specific message. |
| System.String | senderId | The identity of the sender. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
ConfirmProcessing(Int64, String)
Confirm that we've completed processing of a message from a specific sender.
Declaration
IReceiverState ConfirmProcessing(long confirmationId, string senderId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int64 | confirmationId | The correlation id for this specific message. |
| System.String | senderId | The identity of the sender. |
Returns
| Type | Description |
|---|---|
| IReceiverState | A new copy of the IReceiverState or possibly the same. Varies by implementation. |
FromSnapshot(IReceiverStateSnapshot)
Re-populate this object from a IReceiverStateSnapshot.
Declaration
IReceiverState FromSnapshot(IReceiverStateSnapshot snapshot)
Parameters
| Type | Name | Description |
|---|---|---|
| IReceiverStateSnapshot | snapshot | The snapshot recovered from Akka.Persistence. |
Returns
| Type | Description |
|---|---|
| IReceiverState | A new or possibly the same IReceiverState instance, with its data modified by the IReceiverStateSnapshot. |
Prune(TimeSpan)
Used to help reduce memory pressure on systems that have a large number of senders. Prune any sender records that have not been updated in a LONG time.
Declaration
PrunedResult Prune(TimeSpan notUsedSince)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | notUsedSince | The elapsed time since a sender was last used. |
Returns
| Type | Description |
|---|---|
| PrunedResult | An updated state and the list of senders who were pruned during this operation. |
Remarks
You can inadvertently break the de-duplication mechanism used be the DeDuplicatingReceiveActor class whenever you purge the receiver state. The bet you're making is that because messages received from these senders are so infrequent, the possibility of receiving another message you've already confirmed from them is effectively zero, therefore we're better off freeing up the memory used to track them for other senders who might be doing work.
ToSnapshot()
Convert this object into a IReceiverStateSnapshot so it can be serialized.
Declaration
IReceiverStateSnapshot ToSnapshot()
Returns
| Type | Description |
|---|---|
| IReceiverStateSnapshot | A new snapshot object. |