Class SnapshotStoreConnectionBehavior
Built-in SnapshotStore interceptors who will alter messages Recovery and/or Write of TestSnapshotStore.
Inherited Members
Namespace: Akka.Persistence.TestKit
Assembly: Akka.Persistence.TestKit.dll
Syntax
public class SnapshotStoreConnectionBehavior
Methods
| Edit this page View SourceFail()
Always fail all messages.
Declaration
public Task Fail()
Returns
| Type | Description |
|---|---|
| Task |
Remarks
SnapshotStore will crash and UntypedPersistentActor.OnPersistFailure will be called on persistent actor.
Use this SnapshotStore behavior when it is needed to verify how well a persistent actor will handle network problems and similar issues with underlying journal.
FailIf(Func<bool>)
Fail message if predicate predicate will return true.
Declaration
public Task FailIf(Func<bool> predicate)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<bool> | predicate |
Returns
| Type | Description |
|---|---|
| Task |
Remarks
SnapshotStore will crash and UntypedPersistentActor.OnPersistFailure will be called on persistent actor.
Use this SnapshotStore behavior when it is needed to verify how well a persistent actor will handle network problems and similar issues with underlying journal.
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | When |
FailIf(Func<Task<bool>>)
Fail message if async predicate predicate will return true.
Declaration
public Task FailIf(Func<Task<bool>> predicate)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<Task<bool>> | predicate |
Returns
| Type | Description |
|---|---|
| Task |
Remarks
SnapshotStore will crash and UntypedPersistentActor.OnPersistFailure will be called on persistent actor.
Use this SnapshotStore behavior when it is needed to verify how well a persistent actor will handle network problems and similar issues with underlying journal.
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | When |
FailIfWithDelay(TimeSpan, Func<bool>)
Fail message after specified delay if predicate predicate
will return true.
Declaration
public Task FailIfWithDelay(TimeSpan delay, Func<bool> predicate)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | delay | |
| Func<bool> | predicate |
Returns
| Type | Description |
|---|---|
| Task |
Remarks
Each message will be delayed individually.
SnapshotStore will crash and UntypedPersistentActor.OnPersistFailure will be called on persistent actor.
Use this SnapshotStore behavior when it is needed to verify how well a persistent actor will handle network problems and similar issues with underlying journal.
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | When |
| ArgumentNullException | When |
FailIfWithDelay(TimeSpan, Func<Task<bool>>)
Fail message after specified delay if async predicate predicate
will return true.
Declaration
public Task FailIfWithDelay(TimeSpan delay, Func<Task<bool>> predicate)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | delay | |
| Func<Task<bool>> | predicate |
Returns
| Type | Description |
|---|---|
| Task |
Remarks
Each message will be delayed individually.
SnapshotStore will crash and UntypedPersistentActor.OnPersistFailure will be called on persistent actor.
Use this SnapshotStore behavior when it is needed to verify how well a persistent actor will handle network problems and similar issues with underlying journal.
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | When |
| ArgumentNullException | When |
FailUnless(Func<bool>)
Fail message unless predicate predicate will return true.
Declaration
public Task FailUnless(Func<bool> predicate)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<bool> | predicate |
Returns
| Type | Description |
|---|---|
| Task |
Remarks
SnapshotStore will crash and UntypedPersistentActor.OnPersistFailure will be called on persistent actor.
Use this SnapshotStore behavior when it is needed to verify how well a persistent actor will handle network problems and similar issues with underlying journal.
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | When |
FailUnless(Func<Task<bool>>)
Fail message unless async predicate predicate will return true.
Declaration
public Task FailUnless(Func<Task<bool>> predicate)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<Task<bool>> | predicate |
Returns
| Type | Description |
|---|---|
| Task |
Remarks
SnapshotStore will crash and UntypedPersistentActor.OnPersistFailure will be called on persistent actor.
Use this SnapshotStore behavior when it is needed to verify how well a persistent actor will handle network problems and similar issues with underlying journal.
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | When |
FailUnlessWithDelay(TimeSpan, Func<bool>)
Fail message after specified delay unless predicate predicate
will return true.
Declaration
public Task FailUnlessWithDelay(TimeSpan delay, Func<bool> predicate)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | delay | |
| Func<bool> | predicate |
Returns
| Type | Description |
|---|---|
| Task |
Remarks
Each message will be delayed individually.
SnapshotStore will crash and UntypedPersistentActor.OnPersistFailure will be called on persistent actor.
Use this SnapshotStore behavior when it is needed to verify how well a persistent actor will handle network problems and similar issues with underlying journal.
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | When |
| ArgumentNullException | When |
FailUnlessWithDelay(TimeSpan, Func<Task<bool>>)
Fail message after specified delay unless async predicate predicate
will return true.
Declaration
public Task FailUnlessWithDelay(TimeSpan delay, Func<Task<bool>> predicate)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | delay | |
| Func<Task<bool>> | predicate |
Returns
| Type | Description |
|---|---|
| Task |
Remarks
Each message will be delayed individually.
SnapshotStore will crash and UntypedPersistentActor.OnPersistFailure will be called on persistent actor.
Use this SnapshotStore behavior when it is needed to verify how well a persistent actor will handle network problems and similar issues with underlying journal.
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
Each message will be delayed individually.
SnapshotStore will crash and UntypedPersistentActor.OnPersistFailure will be called on persistent actor.
Use this SnapshotStore behavior when it is needed to verify how well a persistent actor will handle network problems and similar issues with underlying journal.
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | When |
Pass()
Pass all messages to journal without interfering.
Declaration
public Task Pass()
Returns
| Type | Description |
|---|---|
| Task |
Remarks
By using this interceptor TestSnapshotStore all journal operations will work like in standard MemorySnapshotStore.
PassWithDelay(TimeSpan)
Delay passing all messages to journal 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(IConnectionInterceptor)
Use custom, user defined interceptor.
Declaration
public Task SetInterceptorAsync(IConnectionInterceptor interceptor)
Parameters
| Type | Name | Description |
|---|---|---|
| IConnectionInterceptor | interceptor | User defined interceptor which implements ISnapshotStoreInterceptor interface. |
Returns
| Type | Description |
|---|---|
| Task |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | When |
Edit this page