Class EventStreamExtensions
- Namespace
- LfrlAnvil.Reactive.Chrono.Extensions
- Assembly
- LfrlAnvil.Reactive.Chrono.dll
Contains IEventStream<TEvent> extension methods.
public static class EventStreamExtensions
- Inheritance
-
EventStreamExtensions
- Inherited Members
Methods
Delay<TEvent>(IEventStream<TEvent>, ITimestampProvider, Duration)
Decorates the event stream with EventListenerDelayDecorator<TEvent>.
[Pure]
public static IEventStream<WithInterval<TEvent>> Delay<TEvent>(this IEventStream<TEvent> source, ITimestampProvider timestampProvider, Duration delay)
Parameters
sourceIEventStream<TEvent>Source event stream.
timestampProviderITimestampProviderTimestamp provider to use for time tracking.
delayDurationEvent delay.
Returns
- IEventStream<WithInterval<TEvent>>
Decorated IEventStream<TEvent> instance.
Type Parameters
TEventEvent type.
Exceptions
- ArgumentOutOfRangeException
When
delayis less than 1 tick or greater than MaxValue milliseconds.
Delay<TEvent>(IEventStream<TEvent>, ITimestampProvider, Duration, Duration)
Decorates the event stream with EventListenerDelayDecorator<TEvent>.
[Pure]
public static IEventStream<WithInterval<TEvent>> Delay<TEvent>(this IEventStream<TEvent> source, ITimestampProvider timestampProvider, Duration delay, Duration spinWaitDurationHint)
Parameters
sourceIEventStream<TEvent>Source event stream.
timestampProviderITimestampProviderTimestamp provider to use for time tracking.
delayDurationEvent delay.
spinWaitDurationHintDurationSpinWait duration hint for the underlying timer.
Returns
- IEventStream<WithInterval<TEvent>>
Decorated IEventStream<TEvent> instance.
Type Parameters
TEventEvent type.
Exceptions
- ArgumentOutOfRangeException
When
delayis less than 1 tick or greater than MaxValue milliseconds or whenspinWaitDurationHintis less than 0.
Delay<TEvent>(IEventStream<TEvent>, ITimestampProvider, Duration, TaskScheduler)
Decorates the event stream with EventListenerDelayDecorator<TEvent>.
[Pure]
public static IEventStream<WithInterval<TEvent>> Delay<TEvent>(this IEventStream<TEvent> source, ITimestampProvider timestampProvider, Duration delay, TaskScheduler scheduler)
Parameters
sourceIEventStream<TEvent>Source event stream.
timestampProviderITimestampProviderTimestamp provider to use for time tracking.
delayDurationEvent delay.
schedulerTaskSchedulerTask scheduler.
Returns
- IEventStream<WithInterval<TEvent>>
Decorated IEventStream<TEvent> instance.
Type Parameters
TEventEvent type.
Exceptions
- ArgumentOutOfRangeException
When
delayis less than 1 tick or greater than MaxValue milliseconds.
Delay<TEvent>(IEventStream<TEvent>, ITimestampProvider, Duration, TaskScheduler, Duration)
Decorates the event stream with EventListenerDelayDecorator<TEvent>.
[Pure]
public static IEventStream<WithInterval<TEvent>> Delay<TEvent>(this IEventStream<TEvent> source, ITimestampProvider timestampProvider, Duration delay, TaskScheduler scheduler, Duration spinWaitDurationHint)
Parameters
sourceIEventStream<TEvent>Source event stream.
timestampProviderITimestampProviderTimestamp provider to use for time tracking.
delayDurationEvent delay.
schedulerTaskSchedulerTask scheduler.
spinWaitDurationHintDurationSpinWait duration hint for the underlying timer.
Returns
- IEventStream<WithInterval<TEvent>>
Decorated IEventStream<TEvent> instance.
Type Parameters
TEventEvent type.
Exceptions
- ArgumentOutOfRangeException
When
delayis less than 1 tick or greater than MaxValue milliseconds or whenspinWaitDurationHintis less than 0.
RegisterTasks<TKey>(IEventStream<WithInterval<long>>, IEnumerable<ITimerTask<TKey>>)
Creates a new TimerTaskCollection<TKey> instance by registering a collection of ITimerTask<TKey> instances in the provided IEventStream.
[Pure]
public static TimerTaskCollection<TKey> RegisterTasks<TKey>(this IEventStream<WithInterval<long>> source, IEnumerable<ITimerTask<TKey>> tasks) where TKey : notnull
Parameters
sourceIEventStream<WithInterval<long>>Source event stream.
tasksIEnumerable<ITimerTask<TKey>>Collection of ITimerTask<TKey> instances to register.
Returns
- TimerTaskCollection<TKey>
New TimerTaskCollection<TKey> instance.
Type Parameters
TKeyTask key type.
Exceptions
- ArgumentException
When task keys are not unique.
WithInterval<TEvent>(IEventStream<TEvent>, ITimestampProvider)
Decorates the event stream with EventListenerWithIntervalDecorator<TEvent>.
[Pure]
public static IEventStream<WithInterval<TEvent>> WithInterval<TEvent>(this IEventStream<TEvent> source, ITimestampProvider timestampProvider)
Parameters
sourceIEventStream<TEvent>Source event stream.
timestampProviderITimestampProviderTimestamp provider to use for time tracking.
Returns
- IEventStream<WithInterval<TEvent>>
Decorated IEventStream<TEvent> instance.
Type Parameters
TEventEvent type.
WithTimestamp<TEvent>(IEventStream<TEvent>, ITimestampProvider)
Decorates the event stream with EventListenerWithTimestampDecorator<TEvent>.
[Pure]
public static IEventStream<WithTimestamp<TEvent>> WithTimestamp<TEvent>(this IEventStream<TEvent> source, ITimestampProvider timestampProvider)
Parameters
sourceIEventStream<TEvent>Source event stream.
timestampProviderITimestampProviderTimestamp provider to use for time tracking.
Returns
- IEventStream<WithTimestamp<TEvent>>
Decorated IEventStream<TEvent> instance.
Type Parameters
TEventEvent type.
WithZonedDateTime<TEvent>(IEventStream<TEvent>, IZonedClock)
Decorates the event stream with EventListenerWithZonedDateTimeDecorator<TEvent>.
[Pure]
public static IEventStream<WithZonedDateTime<TEvent>> WithZonedDateTime<TEvent>(this IEventStream<TEvent> source, IZonedClock clock)
Parameters
sourceIEventStream<TEvent>Source event stream.
clockIZonedClockClock to use for time tracking.
Returns
- IEventStream<WithZonedDateTime<TEvent>>
Decorated IEventStream<TEvent> instance.
Type Parameters
TEventEvent type.