Class MemorySnapshotStore
INTERNAL API.
In-memory SnapshotStore implementation.
Uses a channel-based drain-on-read pattern with immutable collections to handle the concurrent access pattern imposed by SnapshotStore. Writes and deletes enqueue to an unbounded channel (never blocking), and reads drain the channel first to ensure all pending operations are visible before returning results.
Implements
Inherited Members
Namespace: Akka.Persistence.Snapshot
Assembly: Akka.Persistence.dll
Syntax
public class MemorySnapshotStore : SnapshotStore, IInternalActor
Properties
| Edit this page View SourceStorage
Storage property for accessing snapshot data. Override in subclasses to share storage.
Declaration
protected virtual MemorySnapshotStore.SnapshotStorage Storage { get; }
Property Value
| Type | Description |
|---|---|
| MemorySnapshotStore.SnapshotStorage |
Methods
| Edit this page View SourceDeleteAsync(SnapshotMetadata, CancellationToken)
Plugin API: Deletes the snapshot identified by metadata.
This call is protected with a circuit-breaker
Declaration
protected override Task DeleteAsync(SnapshotMetadata metadata, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| SnapshotMetadata | metadata | Snapshot metadata. |
| CancellationToken | cancellationToken | CancellationToken used to signal cancelled snapshot operation |
Returns
| Type | Description |
|---|---|
| Task |
Overrides
| Edit this page View SourceDeleteAsync(string, SnapshotSelectionCriteria, CancellationToken)
Plugin API: Deletes all snapshots matching provided criteria.
This call is protected with a circuit-breaker
Declaration
protected override Task DeleteAsync(string persistenceId, SnapshotSelectionCriteria criteria, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | persistenceId | Id of the persistent actor. |
| SnapshotSelectionCriteria | criteria | Selection criteria for deleting. |
| CancellationToken | cancellationToken | CancellationToken used to signal cancelled snapshot operation |
Returns
| Type | Description |
|---|---|
| Task |
Overrides
| Edit this page View SourceLoadAsync(string, SnapshotSelectionCriteria, CancellationToken)
Plugin API: Asynchronously loads a snapshot.
This call is protected with a circuit-breaker
Declaration
protected override Task<SelectedSnapshot> LoadAsync(string persistenceId, SnapshotSelectionCriteria criteria, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | persistenceId | Id of the persistent actor. |
| SnapshotSelectionCriteria | criteria | Selection criteria for loading. |
| CancellationToken | cancellationToken | CancellationToken used to signal cancelled snapshot operation |
Returns
| Type | Description |
|---|---|
| Task<SelectedSnapshot> |
Overrides
| Edit this page View SourceSaveAsync(SnapshotMetadata, object, CancellationToken)
Plugin API: Asynchronously saves a snapshot.
This call is protected with a circuit-breaker
Declaration
protected override Task SaveAsync(SnapshotMetadata metadata, object snapshot, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| SnapshotMetadata | metadata | Snapshot metadata. |
| object | snapshot | Snapshot. |
| CancellationToken | cancellationToken | CancellationToken used to signal cancelled snapshot operation |
Returns
| Type | Description |
|---|---|
| Task |
Edit this page