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
| Improve this Doc 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<Boolean>)
Fail message if predicate predicate
will return true
.
Declaration
public Task FailIf(Func<bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
Func<Boolean> | 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<Boolean>>)
Fail message if async predicate predicate
will return true
.
Declaration
public Task FailIf(Func<Task<bool>> predicate)
Parameters
Type | Name | Description |
---|---|---|
Func<Task<Boolean>> | 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<Boolean>)
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<Boolean> | 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<Boolean>>)
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<Boolean>> | 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<Boolean>)
Fail message unless predicate predicate
will return true
.
Declaration
public Task FailUnless(Func<bool> predicate)
Parameters
Type | Name | Description |
---|---|---|
Func<Boolean> | 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<Boolean>>)
Fail message unless async predicate predicate
will return true
.
Declaration
public Task FailUnless(Func<Task<bool>> predicate)
Parameters
Type | Name | Description |
---|---|---|
Func<Task<Boolean>> | 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<Boolean>)
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<Boolean> | 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<Boolean>>)
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<Boolean>> | 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 |