Skip to content

,System.TimeSpan)} ,System.TimeSpan,System.Reactive.Concurrency.IScheduler)} ,System.DateTimeOffset)} ,System.DateTimeOffset,System.Reactive.Concurrency.IScheduler)}

Observable.DelaySubscription(IObservable, TimeSpan) method

Defined in

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

Applies to

netstandard2.0

Overloads

  • 1. public static IObservable<TSource> DelaySubscription<TSource>(this IObservable<TSource> source, TimeSpan dueTime)
  • 2. public static IObservable<TSource> DelaySubscription<TSource>(this IObservable<TSource> source, TimeSpan dueTime, IScheduler scheduler)
  • 3. public static IObservable<TSource> DelaySubscription<TSource>(this IObservable<TSource> source, DateTimeOffset dueTime)
  • 4. public static IObservable<TSource> DelaySubscription<TSource>(this IObservable<TSource> source, DateTimeOffset dueTime, IScheduler scheduler)

1. Overload

public static IObservable<TSource> DelaySubscription<TSource>(this IObservable<TSource> source, TimeSpan dueTime)

Summary: Time shifts the observable sequence by delaying the subscription with the specified relative time duration.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
sourceIObservableSource sequence to delay subscription for.
dueTimeTimeSpanRelative time shift of the subscription.

Returns: IObservable -- Time-shifted sequence.

Remarks

This operator is more efficient than Delay but postpones all side-effects of subscription and affects error propagation timing.

The side-effects of subscribing to the source sequence will be run on the default scheduler. Observer callbacks will not be affected.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource is null.
System.ArgumentOutOfRangeExceptiondueTime is less than TimeSpan.Zero.

2. Overload

public static IObservable<TSource> DelaySubscription<TSource>(this IObservable<TSource> source, TimeSpan dueTime, IScheduler scheduler)

Summary: Time shifts the observable sequence by delaying the subscription with the specified relative time duration, using the specified scheduler to run timers.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
sourceIObservableSource sequence to delay subscription for.
dueTimeTimeSpanRelative time shift of the subscription.
scheduler[IScheduler](#Scheduler to run the subscription delay timer on.

Returns: IObservable -- Time-shifted sequence.

Remarks

This operator is more efficient than Delay but postpones all side-effects of subscription and affects error propagation timing.

The side-effects of subscribing to the source sequence will be run on the specified scheduler. Observer callbacks will not be affected.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or scheduler is null.
System.ArgumentOutOfRangeExceptiondueTime is less than TimeSpan.Zero.

3. Overload

public static IObservable<TSource> DelaySubscription<TSource>(this IObservable<TSource> source, DateTimeOffset dueTime)

Summary: Time shifts the observable sequence by delaying the subscription to the specified absolute time.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
sourceIObservableSource sequence to delay subscription for.
dueTimeDateTimeOffsetAbsolute time to perform the subscription at.

Returns: IObservable -- Time-shifted sequence.

Remarks

This operator is more efficient than Delay but postpones all side-effects of subscription and affects error propagation timing.

The side-effects of subscribing to the source sequence will be run on the default scheduler. Observer callbacks will not be affected.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource is null.

4. Overload

public static IObservable<TSource> DelaySubscription<TSource>(this IObservable<TSource> source, DateTimeOffset dueTime, IScheduler scheduler)

Summary: Time shifts the observable sequence by delaying the subscription to the specified absolute time, using the specified scheduler to run timers.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
sourceIObservableSource sequence to delay subscription for.
dueTimeDateTimeOffsetAbsolute time to perform the subscription at.
scheduler[IScheduler](#Scheduler to run the subscription delay timer on.

Returns: IObservable -- Time-shifted sequence.

Remarks

This operator is more efficient than Delay but postpones all side-effects of subscription and affects error propagation timing.

The side-effects of subscribing to the source sequence will be run on the specified scheduler. Observer callbacks will not be affected.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or scheduler is null.