Skip to content

Qbservable.Interval(IQbservableProvider, TimeSpan) method

Defined in

Type: Qbservable Namespace: System.Reactive.Linq Assembly: System.Reactive.dll

Applies to

netstandard2.0

Overloads

  • 1. public static IQbservable<long> Interval(this IQbservableProvider provider, TimeSpan period)
  • 2. public static IQbservable<long> Interval(this IQbservableProvider provider, TimeSpan period, IScheduler scheduler)

1. Overload

public static IQbservable<long> Interval(this IQbservableProvider provider, TimeSpan period)

Summary: Returns an observable sequence that produces a value after each period.

Parameters

NameTypeDescription
provider[IQbservableProvider](#Query provider used to construct the [IQbservable](# data source.
periodTimeSpanPeriod for producing the values in the resulting sequence. If this value is equal to TimeSpan.Zero, the timer will recur as fast as possible.

Returns: IQbservable -- An observable sequence that produces a value after each period.

Remarks

Intervals are measured between the start of subsequent notifications, not between the end of the previous and the start of the next notification. If the observer takes longer than the interval period to handle the message, the subsequent notification will be delivered immediately after the current one has been handled. In case you need to control the time between the end and the start of consecutive notifications, consider using the Generate operator instead.

Exceptions

TypeCondition
System.ArgumentOutOfRangeExceptionperiod is less than TimeSpan.Zero.

2. Overload

public static IQbservable<long> Interval(this IQbservableProvider provider, TimeSpan period, IScheduler scheduler)

Summary: Returns an observable sequence that produces a value after each period, using the specified scheduler to run timers and to send out observer messages.

Parameters

NameTypeDescription
provider[IQbservableProvider](#Query provider used to construct the [IQbservable](# data source.
periodTimeSpanPeriod for producing the values in the resulting sequence. If this value is equal to TimeSpan.Zero, the timer will recur as fast as possible.
scheduler[IScheduler](#Scheduler to run the timer on.

Returns: IQbservable -- An observable sequence that produces a value after each period.

Remarks

Intervals are measured between the start of subsequent notifications, not between the end of the previous and the start of the next notification. If the observer takes longer than the interval period to handle the message, the subsequent notification will be delivered immediately after the current one has been handled. In case you need to control the time between the end and the start of consecutive notifications, consider using the Generate operator instead.

Exceptions

TypeCondition
System.ArgumentOutOfRangeExceptionperiod is less than TimeSpan.Zero.
System.ArgumentNullExceptionscheduler is null.