Table of Contents

Class ChronoEventSource

Namespace
LfrlAnvil.Reactive.Chrono
Assembly
LfrlAnvil.Reactive.Chrono.dll

Creates instances of IntervalEventSource type.

public static class ChronoEventSource
Inheritance
ChronoEventSource
Inherited Members

Methods

Interval(Duration, Duration, ITimestampProvider?, ValueTaskDelaySource?)

Creates a new IntervalEventSource instance.

[Pure]
public static IntervalEventSource Interval(Duration interval, Duration spinWaitDurationHint, ITimestampProvider? timestampProvider = null, ValueTaskDelaySource? delaySource = null)

Parameters

interval Duration

Interval between subsequent timer events.

spinWaitDurationHint Duration

SpinWait duration hint for underlying timers.

timestampProvider ITimestampProvider

Optional timestamp provider used for time tracking.

delaySource ValueTaskDelaySource

Optional value task delay source to use for scheduling delays.

Returns

IntervalEventSource

New IntervalEventSource instance.

Exceptions

ArgumentOutOfRangeException

When interval is less than 1 tick or greater than MaxValue milliseconds or when spinWaitDurationHint is less than 0.

Interval(Duration, Duration, long, ITimestampProvider?, ValueTaskDelaySource?)

Creates a new IntervalEventSource instance.

[Pure]
public static IntervalEventSource Interval(Duration interval, Duration spinWaitDurationHint, long count, ITimestampProvider? timestampProvider = null, ValueTaskDelaySource? delaySource = null)

Parameters

interval Duration

Interval between subsequent timer events.

spinWaitDurationHint Duration

SpinWait duration hint for underlying timers.

count long

Number of events underlying timers will emit in total. Equal to MaxValue by default.

timestampProvider ITimestampProvider

Optional timestamp provider used for time tracking.

delaySource ValueTaskDelaySource

Optional value task delay source to use for scheduling delays.

Returns

IntervalEventSource

New IntervalEventSource instance.

Exceptions

ArgumentOutOfRangeException

When count is less than 1 or when interval is less than 1 tick or greater than MaxValue milliseconds or when spinWaitDurationHint is less than 0.

Interval(Duration, ITimestampProvider?, ValueTaskDelaySource?)

Creates a new IntervalEventSource instance.

[Pure]
public static IntervalEventSource Interval(Duration interval, ITimestampProvider? timestampProvider = null, ValueTaskDelaySource? delaySource = null)

Parameters

interval Duration

Interval between subsequent timer events.

timestampProvider ITimestampProvider

Optional timestamp provider used for time tracking.

delaySource ValueTaskDelaySource

Optional value task delay source to use for scheduling delays.

Returns

IntervalEventSource

New IntervalEventSource instance.

Exceptions

ArgumentOutOfRangeException

When interval is less than 1 tick or greater than MaxValue milliseconds

Interval(Duration, long, ITimestampProvider?, ValueTaskDelaySource?)

Creates a new IntervalEventSource instance.

[Pure]
public static IntervalEventSource Interval(Duration interval, long count, ITimestampProvider? timestampProvider = null, ValueTaskDelaySource? delaySource = null)

Parameters

interval Duration

Interval between subsequent timer events.

count long

Number of events underlying timers will emit in total. Equal to MaxValue by default.

timestampProvider ITimestampProvider

Optional timestamp provider used for time tracking.

delaySource ValueTaskDelaySource

Optional value task delay source to use for scheduling delays.

Returns

IntervalEventSource

New IntervalEventSource instance.

Exceptions

ArgumentOutOfRangeException

When count is less than 1 or when interval is less than 1 tick or greater than MaxValue milliseconds.

Timeout(Duration, Duration, ITimestampProvider?, ValueTaskDelaySource?)

Creates a new IntervalEventSource instance with a single emitted event.

[Pure]
public static IntervalEventSource Timeout(Duration timeout, Duration spinWaitDurationHint, ITimestampProvider? timestampProvider = null, ValueTaskDelaySource? delaySource = null)

Parameters

timeout Duration

Delay before timer event is emitted.

spinWaitDurationHint Duration

SpinWait duration hint for underlying timers.

timestampProvider ITimestampProvider

Optional timestamp provider used for time tracking.

delaySource ValueTaskDelaySource

Optional value task delay source to use for scheduling delays.

Returns

IntervalEventSource

New IntervalEventSource instance.

Exceptions

ArgumentOutOfRangeException

When timeout is less than 1 tick or greater than MaxValue milliseconds or when spinWaitDurationHint is less than 0.

Timeout(Duration, ITimestampProvider?, ValueTaskDelaySource?)

Creates a new IntervalEventSource instance with a single emitted event.

[Pure]
public static IntervalEventSource Timeout(Duration timeout, ITimestampProvider? timestampProvider = null, ValueTaskDelaySource? delaySource = null)

Parameters

timeout Duration

Delay before timer event is emitted.

timestampProvider ITimestampProvider

Optional timestamp provider used for time tracking.

delaySource ValueTaskDelaySource

Optional value task delay source to use for scheduling delays.

Returns

IntervalEventSource

New IntervalEventSource instance.

Exceptions

ArgumentOutOfRangeException

When timeout is less than 1 tick or greater than MaxValue milliseconds.