Table of Contents

Class ReactorWaitExtensions

Namespace
Cratis.Chronicle.Reactors
Assembly
Cratis.Chronicle.dll

Helper extensions providing wait methods for projections.

public static class ReactorWaitExtensions
Inheritance
ReactorWaitExtensions
Inherited Members

Remarks

These extensions are very useful for integration testing purposes.

Methods

WaitForState(IReactorHandler, ObserverRunningState, TimeSpan?)

Wait for the reactor to reach a specific running state.

public static Task WaitForState(this IReactorHandler reactor, ObserverRunningState runningState, TimeSpan? timeout = null)

Parameters

reactor IReactorHandler

Reactor to wait for.

runningState ObserverRunningState

The expected ObserverRunningState to wait for.

timeout TimeSpan?

Optional timeout. If none is provided, it will default to 5 seconds.

Returns

Task

Awaitable task.

WaitForState<TReactor>(IReactors, ObserverRunningState, TimeSpan?)

Wait for the reactor to reach a specific running state.

public static Task WaitForState<TReactor>(this IReactors reactors, ObserverRunningState runningState, TimeSpan? timeout = null) where TReactor : IReactor

Parameters

reactors IReactors

Reactor system to wait for the specific reactor for.

runningState ObserverRunningState

The expected ObserverRunningState to wait for.

timeout TimeSpan?

Optional timeout. If none is provided, it will default to 5 seconds.

Returns

Task

Awaitable task.

Type Parameters

TReactor

Type of reactor to wait for.

WaitForThereToBeFailedPartitions(IReactorHandler, TimeSpan?)

Wait for there to be failed partitions for a specific reactor, with an optional timeout.

public static Task<IEnumerable<FailedPartition>> WaitForThereToBeFailedPartitions(this IReactorHandler reactor, TimeSpan? timeout = null)

Parameters

reactor IReactorHandler

Reactor to wait for.

timeout TimeSpan?

Optional timeout. If none is provided, it will default to 5 seconds.

Returns

Task<IEnumerable<FailedPartition>>

Awaitable task.

WaitForThereToBeFailedPartitions<TReactor>(IReactors, TimeSpan?)

Wait for there to be failed partitions for a specific reactor, with an optional timeout.

public static Task<IEnumerable<FailedPartition>> WaitForThereToBeFailedPartitions<TReactor>(this IReactors reactors, TimeSpan? timeout = null) where TReactor : IReactor

Parameters

reactors IReactors

Reactor system to wait for the specific reactor for.

timeout TimeSpan?

Optional timeout. If none is provided, it will default to 5 seconds.

Returns

Task<IEnumerable<FailedPartition>>

Awaitable task.

Type Parameters

TReactor

Type of reactor to wait for.

WaitTillActive(IReactorHandler, TimeSpan?)

Wait till the reactor is active, with an optional timeout.

public static Task WaitTillActive(this IReactorHandler reactor, TimeSpan? timeout = null)

Parameters

reactor IReactorHandler

Reactor to wait for.

timeout TimeSpan?

Optional timeout. If none is provided, it will default to 5 seconds.

Returns

Task

Awaitable task.

WaitTillActive<TReactor>(IReactors, TimeSpan?)

Wait till the reactor is active, with an optional timeout.

public static Task WaitTillActive<TReactor>(this IReactors reactors, TimeSpan? timeout = null) where TReactor : IReactor

Parameters

reactors IReactors

Reactor system to wait for the specific reactor for.

timeout TimeSpan?

Optional timeout. If none is provided, it will default to 5 seconds.

Returns

Task

Awaitable task.

Type Parameters

TReactor

Type of reactor to wait for.

WaitTillReachesEventSequenceNumber(IReactorHandler, EventSequenceNumber, TimeSpan?)

Wait till the reactor reaches a specific event sequence number, with an optional timeout.

public static Task WaitTillReachesEventSequenceNumber(this IReactorHandler reactor, EventSequenceNumber eventSequenceNumber, TimeSpan? timeout = null)

Parameters

reactor IReactorHandler

Reactor to wait for.

eventSequenceNumber EventSequenceNumber

The expected EventSequenceNumber to wait for.

timeout TimeSpan?

Optional timeout. If none is provided, it will default to 5 seconds.

Returns

Task

Awaitable task.

WaitTillReachesEventSequenceNumber<TReactor>(IReactors, EventSequenceNumber, TimeSpan?)

Wait till the reactor reaches a specific event sequence number, with an optional timeout.

public static Task WaitTillReachesEventSequenceNumber<TReactor>(this IReactors reactors, EventSequenceNumber eventSequenceNumber, TimeSpan? timeout = null) where TReactor : IReactor

Parameters

reactors IReactors

Reactor system to wait for the specific reactor for.

eventSequenceNumber EventSequenceNumber

The expected EventSequenceNumber to wait for.

timeout TimeSpan?

Optional timeout. If none is provided, it will default to 5 seconds.

Returns

Task

Awaitable task.

Type Parameters

TReactor

Type of reactor to wait for.

WaitTillSubscribed(IReactorHandler, TimeSpan?)

Wait till the reactor has been subscribed, with an optional timeout.

public static Task WaitTillSubscribed(this IReactorHandler reactor, TimeSpan? timeout = null)

Parameters

reactor IReactorHandler

Reactor to wait for.

timeout TimeSpan?

Optional timeout. If none is provided, it will default to 5 seconds.

Returns

Task

Awaitable task.

WaitTillSubscribed<TReactor>(IReactors, TimeSpan?)

Wait till the reactor has been subscribed, with an optional timeout.

public static Task WaitTillSubscribed<TReactor>(this IReactors reactors, TimeSpan? timeout = null) where TReactor : IReactor

Parameters

reactors IReactors

Reactor system to wait for the specific reactor for.

timeout TimeSpan?

Optional timeout. If none is provided, it will default to 5 seconds.

Returns

Task

Awaitable task.

Type Parameters

TReactor

Type of reactor to wait for.