Class SnapshotStoreSaveBehavior
Built-in snapshot store interceptors who will alter message Write of TestSnapshotStore.
Inherited Members
Namespace: Akka.Persistence.TestKit
Assembly: Akka.Persistence.TestKit.dll
Syntax
public class SnapshotStoreSaveBehavior
Constructors
| Improve this Doc View SourceSnapshotStoreSaveBehavior(ISnapshotStoreBehaviorSetter)
Declaration
public SnapshotStoreSaveBehavior(ISnapshotStoreBehaviorSetter setter)
Parameters
Type | Name | Description |
---|---|---|
ISnapshotStoreBehaviorSetter | setter |
Fields
| Improve this Doc View SourceSetter
Declaration
protected readonly ISnapshotStoreBehaviorSetter Setter
Field Value
Type | Description |
---|---|
ISnapshotStoreBehaviorSetter |
Methods
| Improve this Doc View SourceFail()
Always fail all messages.
Declaration
public Task Fail()
Returns
Type | Description |
---|---|
Task |
Remarks
Snapshot store will crash and actor will receive one of SaveSnapshotFailure, DeleteSnapshotFailure or DeleteSnapshotsFailure messages.
Use this snapshot store behavior when it is needed to verify how well a persistent actor will handle network problems and similar issues with underlying snapshot store.
FailIf(Func<String, SnapshotSelectionCriteria, Boolean>)
Fail message if predicate predicate
will return true
.
Declaration
public Task FailIf(Func<string, SnapshotSelectionCriteria, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
Func<String, SnapshotSelectionCriteria, Boolean> | predicate |
Returns
Type | Description |
---|---|
Task |
Remarks
Snapshot store will crash and actor will receive one of SaveSnapshotFailure, DeleteSnapshotFailure or DeleteSnapshotsFailure messages.
Use this snapshot store behavior when it is needed to verify how well a persistent actor will handle network problems and similar issues with underlying snapshot store.
Exceptions
Type | Condition |
---|---|
ArgumentNullException | When |
FailIf(Func<String, SnapshotSelectionCriteria, Task<Boolean>>)
Fail message if async predicate predicate
will return true
.
Declaration
public Task FailIf(Func<string, SnapshotSelectionCriteria, Task<bool>> predicate)
Parameters
Type | Name | Description |
---|---|---|
Func<String, SnapshotSelectionCriteria, Task<Boolean>> | predicate |
Returns
Type | Description |
---|---|
Task |
Remarks
Snapshot store will crash and actor will receive one of SaveSnapshotFailure, DeleteSnapshotFailure or DeleteSnapshotsFailure messages.
Use this snapshot store behavior when it is needed to verify how well a persistent actor will handle network problems and similar issues with underlying snapshot store.
Exceptions
Type | Condition |
---|---|
ArgumentNullException | When |
FailIfWithDelay(TimeSpan, Func<String, SnapshotSelectionCriteria, Boolean>)
Fail message after specified delay if predicate predicate
will return true
.
Declaration
public Task FailIfWithDelay(TimeSpan delay, Func<string, SnapshotSelectionCriteria, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | delay | |
Func<String, SnapshotSelectionCriteria, Boolean> | predicate |
Returns
Type | Description |
---|---|
Task |
Remarks
Snapshot store will crash and actor will receive one of SaveSnapshotFailure, DeleteSnapshotFailure or DeleteSnapshotsFailure messages.
Use this snapshot store behavior when it is needed to verify how well a persistent actor will handle network problems
Exceptions
Type | Condition |
---|---|
ArgumentException | When |
ArgumentNullException | When |
FailIfWithDelay(TimeSpan, Func<String, SnapshotSelectionCriteria, Task<Boolean>>)
Fail message after specified delay if async predicate predicate
will return true
.
Declaration
public Task FailIfWithDelay(TimeSpan delay, Func<string, SnapshotSelectionCriteria, Task<bool>> predicate)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | delay | |
Func<String, SnapshotSelectionCriteria, Task<Boolean>> | predicate |
Returns
Type | Description |
---|---|
Task |
Remarks
Snapshot store will crash and actor will receive one of SaveSnapshotFailure, DeleteSnapshotFailure or DeleteSnapshotsFailure messages.
Use this snapshot store behavior when it is needed to verify how well a persistent actor will handle network problems
Exceptions
Type | Condition |
---|---|
ArgumentException | When |
ArgumentNullException | When |
FailUnless(Func<String, SnapshotSelectionCriteria, Boolean>)
Fail message unless predicate predicate
will return true
.
Declaration
public Task FailUnless(Func<string, SnapshotSelectionCriteria, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
Func<String, SnapshotSelectionCriteria, Boolean> | predicate |
Returns
Type | Description |
---|---|
Task |
Remarks
Snapshot store will crash and actor will receive one of SaveSnapshotFailure, DeleteSnapshotFailure or DeleteSnapshotsFailure messages.
Use this snapshot store behavior when it is needed to verify how well a persistent actor will handle network problems and similar issues with underlying snapshot store.
Exceptions
Type | Condition |
---|---|
ArgumentNullException | When |
FailUnless(Func<String, SnapshotSelectionCriteria, Task<Boolean>>)
Fail message unless async predicate predicate
will return true
.
Declaration
public Task FailUnless(Func<string, SnapshotSelectionCriteria, Task<bool>> predicate)
Parameters
Type | Name | Description |
---|---|---|
Func<String, SnapshotSelectionCriteria, Task<Boolean>> | predicate |
Returns
Type | Description |
---|---|
Task |
Remarks
Snapshot store will crash and actor will receive one of SaveSnapshotFailure, DeleteSnapshotFailure or DeleteSnapshotsFailure messages.
Use this snapshot store behavior when it is needed to verify how well a persistent actor will handle network problems and similar issues with underlying snapshot store.
Exceptions
Type | Condition |
---|---|
ArgumentNullException | When |
FailUnlessWithDelay(TimeSpan, Func<String, SnapshotSelectionCriteria, Boolean>)
Fail message after specified delay unless predicate predicate
will return true
.
Declaration
public Task FailUnlessWithDelay(TimeSpan delay, Func<string, SnapshotSelectionCriteria, bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | delay | |
Func<String, SnapshotSelectionCriteria, Boolean> | predicate |
Returns
Type | Description |
---|---|
Task |
Remarks
Snapshot store will crash and actor will receive one of SaveSnapshotFailure, DeleteSnapshotFailure or DeleteSnapshotsFailure messages.
Use this snapshot store behavior when it is needed to verify how well a persistent actor will handle network problems
Exceptions
Type | Condition |
---|---|
ArgumentException | When |
ArgumentNullException | When |
FailUnlessWithDelay(TimeSpan, Func<String, SnapshotSelectionCriteria, Task<Boolean>>)
Fail message after specified delay unless async predicate predicate
will return true
.
Declaration
public Task FailUnlessWithDelay(TimeSpan delay, Func<string, SnapshotSelectionCriteria, Task<bool>> predicate)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | delay | |
Func<String, SnapshotSelectionCriteria, Task<Boolean>> | predicate |
Returns
Type | Description |
---|---|
Task |
Remarks
Snapshot store will crash and actor will receive one of SaveSnapshotFailure, DeleteSnapshotFailure or DeleteSnapshotsFailure messages.
Use this snapshot store behavior when it is needed to verify how well a persistent actor will handle network problems
Exceptions
Type | Condition |
---|---|
ArgumentException | When |
ArgumentNullException | When |
FailWithDelay(TimeSpan)
Fail message after specified delay.
Declaration
public Task FailWithDelay(TimeSpan delay)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | delay |
Returns
Type | Description |
---|---|
Task |
Remarks
Snapshot store will crash and actor will receive one of SaveSnapshotFailure, DeleteSnapshotFailure or DeleteSnapshotsFailure messages.
Use this snapshot store behavior when it is needed to verify how well a persistent actor will handle network problems
Exceptions
Type | Condition |
---|---|
ArgumentException | When |
Pass()
Pass all messages to snapshot store without interfering.
Declaration
public Task Pass()
Returns
Type | Description |
---|---|
Task |
Remarks
By using this interceptor TestSnapshotStore all snapshot store operations will work like in standard MemorySnapshotStore.
PassWithDelay(TimeSpan)
Delay passing all messages to snapshot store by delay
.
Declaration
public Task PassWithDelay(TimeSpan delay)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | delay | Time by which recovery operation will be delayed. |
Returns
Type | Description |
---|---|
Task |
Remarks
Each message will be delayed individually.
Exceptions
Type | Condition |
---|---|
ArgumentException | When |
SetInterceptorAsync(ISnapshotStoreInterceptor)
Use custom, user defined interceptor.
Declaration
public Task SetInterceptorAsync(ISnapshotStoreInterceptor interceptor)
Parameters
Type | Name | Description |
---|---|---|
ISnapshotStoreInterceptor | interceptor | User defined interceptor which implements ISnapshotStoreInterceptor interface. |
Returns
Type | Description |
---|---|
Task |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | When |