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
| Edit this page View SourceSnapshotStoreSaveBehavior(ISnapshotStoreBehaviorSetter)
Declaration
public SnapshotStoreSaveBehavior(ISnapshotStoreBehaviorSetter setter)
Parameters
| Type | Name | Description |
|---|---|---|
| ISnapshotStoreBehaviorSetter | setter |
Fields
| Edit this page View SourceSetter
Declaration
protected readonly ISnapshotStoreBehaviorSetter Setter
Field Value
| Type | Description |
|---|---|
| ISnapshotStoreBehaviorSetter |
Methods
| Edit this page 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, bool>)
Fail message if predicate predicate will return true.
Declaration
public Task FailIf(Func<string, SnapshotSelectionCriteria, bool> predicate)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<string, SnapshotSelectionCriteria, bool> | 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<bool>>)
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<bool>> | 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, bool>)
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, bool> | 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<bool>>)
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<bool>> | 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, bool>)
Fail message unless predicate predicate will return true.
Declaration
public Task FailUnless(Func<string, SnapshotSelectionCriteria, bool> predicate)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<string, SnapshotSelectionCriteria, bool> | 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<bool>>)
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<bool>> | 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, bool>)
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, bool> | 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<bool>>)
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<bool>> | 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 |
Edit this page