Class ReducerWaitExtensions
Helper extensions providing wait methods for reducers.
public static class ReducerWaitExtensions
- Inheritance
-
ReducerWaitExtensions
- Inherited Members
Remarks
These extensions are very useful for integration testing purposes.
Methods
WaitForState(IReducerHandler, ObserverRunningState, TimeSpan?)
Wait for the reducer to reach a specific running state.
public static Task WaitForState(this IReducerHandler reducer, ObserverRunningState runningState, TimeSpan? timeout = null)
Parameters
reducerIReducerHandlerReducer to wait for.
runningStateObserverRunningStateThe expected ObserverRunningState to wait for.
timeoutTimeSpan?Optional timeout. If none is provided, it will default to 5 seconds.
Returns
- Task
Awaitable task.
WaitForState<TReducer>(IReducers, ObserverRunningState, TimeSpan?)
Wait for the reducer to reach a specific running state.
public static Task WaitForState<TReducer>(this IReducers reducers, ObserverRunningState runningState, TimeSpan? timeout = null) where TReducer : IReducer
Parameters
reducersIReducersReducer system to wait for the specific reducer for.
runningStateObserverRunningStateThe expected ObserverRunningState to wait for.
timeoutTimeSpan?Optional timeout. If none is provided, it will default to 5 seconds.
Returns
- Task
Awaitable task.
Type Parameters
TReducerType of reducer to wait for.
WaitForThereToBeFailedPartitions(IReducerHandler, TimeSpan?)
Wait for there to be failed partitions for a specific reducer, with an optional timeout.
public static Task<IEnumerable<FailedPartition>> WaitForThereToBeFailedPartitions(this IReducerHandler reducer, TimeSpan? timeout = null)
Parameters
reducerIReducerHandlerReducer to wait for.
timeoutTimeSpan?Optional timeout. If none is provided, it will default to 5 seconds.
Returns
- Task<IEnumerable<FailedPartition>>
Awaitable task.
WaitForThereToBeFailedPartitions<TReducer>(IReducers, TimeSpan?)
Wait for there to be failed partitions for a specific reducer, with an optional timeout.
public static Task<IEnumerable<FailedPartition>> WaitForThereToBeFailedPartitions<TReducer>(this IReducers reducers, TimeSpan? timeout = null) where TReducer : IReducer
Parameters
reducersIReducersReducer system to wait for the specific reducer for.
timeoutTimeSpan?Optional timeout. If none is provided, it will default to 5 seconds.
Returns
- Task<IEnumerable<FailedPartition>>
Awaitable task.
Type Parameters
TReducerType of reactor to wait for.
WaitTillActive(IReducerHandler, TimeSpan?)
Wait till the reducer is active, with an optional timeout.
public static Task WaitTillActive(this IReducerHandler reducer, TimeSpan? timeout = null)
Parameters
reducerIReducerHandlerReducer to wait for.
timeoutTimeSpan?Optional timeout. If none is provided, it will default to 5 seconds.
Returns
- Task
Awaitable task.
WaitTillActive<TReducer>(IReducers, TimeSpan?)
Wait till the reducer is active, with an optional timeout.
public static Task WaitTillActive<TReducer>(this IReducers reducers, TimeSpan? timeout = null) where TReducer : IReducer
Parameters
reducersIReducersReducer system to wait for the specific reducer for.
timeoutTimeSpan?Optional timeout. If none is provided, it will default to 5 seconds.
Returns
- Task
Awaitable task.
Type Parameters
TReducerType of reactor to wait for.
WaitTillReachesEventSequenceNumber(IReducerHandler, EventSequenceNumber, TimeSpan?)
Wait till the reducer reaches a specific event sequence number, with an optional timeout.
public static Task WaitTillReachesEventSequenceNumber(this IReducerHandler reducer, EventSequenceNumber eventSequenceNumber, TimeSpan? timeout = null)
Parameters
reducerIReducerHandlerReducer to wait for.
eventSequenceNumberEventSequenceNumberThe expected EventSequenceNumber to wait for.
timeoutTimeSpan?Optional timeout. If none is provided, it will default to 5 seconds.
Returns
- Task
Awaitable task.
WaitTillReachesEventSequenceNumber<TReducer>(IReducers, EventSequenceNumber, TimeSpan?)
Wait till the reducer reaches a specific event sequence number, with an optional timeout.
public static Task WaitTillReachesEventSequenceNumber<TReducer>(this IReducers reducers, EventSequenceNumber eventSequenceNumber, TimeSpan? timeout = null) where TReducer : IReducer
Parameters
reducersIReducersReducer system to wait for the specific reducer for.
eventSequenceNumberEventSequenceNumberThe expected EventSequenceNumber to wait for.
timeoutTimeSpan?Optional timeout. If none is provided, it will default to 5 seconds.
Returns
- Task
Awaitable task.
Type Parameters
TReducerType of reactor to wait for.
WaitTillSubscribed(IReducerHandler, TimeSpan?)
Wait till the reactor has been subscribed, with an optional timeout.
public static Task WaitTillSubscribed(this IReducerHandler reducer, TimeSpan? timeout = null)
Parameters
reducerIReducerHandlerReducer to wait for.
timeoutTimeSpan?Optional timeout. If none is provided, it will default to 5 seconds.
Returns
- Task
Awaitable task.
WaitTillSubscribed<TReducer>(IReducers, TimeSpan?)
Wait till the reactor has been subscribed, with an optional timeout.
public static Task WaitTillSubscribed<TReducer>(this IReducers reducers, TimeSpan? timeout = null) where TReducer : IReducer
Parameters
reducersIReducersReducer system to wait for the specific reducer for.
timeoutTimeSpan?Optional timeout. If none is provided, it will default to 5 seconds.
Returns
- Task
Awaitable task.
Type Parameters
TReducerType of reactor to wait for.