Skip to content

)} ,System.Int32)}

Observable.Repeat(TResult) method

Defined in

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

Applies to

netstandard2.0

Overloads

  • 1. public static IObservable<TResult> Repeat<TResult>(TResult value)
  • 2. public static IObservable<TResult> Repeat<TResult>(TResult value, IScheduler scheduler)
  • 3. public static IObservable<TResult> Repeat<TResult>(TResult value, int repeatCount)
  • 4. public static IObservable<TResult> Repeat<TResult>(TResult value, int repeatCount, IScheduler scheduler)
  • 5. public static IObservable<TSource> Repeat<TSource>(this IObservable<TSource> source)
  • 6. public static IObservable<TSource> Repeat<TSource>(this IObservable<TSource> source, int repeatCount)

1. Overload

public static IObservable<TResult> Repeat<TResult>(TResult value)

Summary: Generates an observable sequence that repeats the given element infinitely.

Type parameters

NameDescription
TResultThe type of the element that will be repeated in the produced sequence.

Parameters

NameTypeDescription
valueTResultElement to repeat.

Returns: IObservable -- An observable sequence that repeats the given element infinitely.

2. Overload

public static IObservable<TResult> Repeat<TResult>(TResult value, IScheduler scheduler)

Summary: Generates an observable sequence that repeats the given element infinitely, using the specified scheduler to send out observer messages.

Type parameters

NameDescription
TResultThe type of the element that will be repeated in the produced sequence.

Parameters

NameTypeDescription
valueTResultElement to repeat.
scheduler[IScheduler](#Scheduler to run the producer loop on.

Returns: IObservable -- An observable sequence that repeats the given element infinitely.

Exceptions

TypeCondition
System.ArgumentNullExceptionscheduler is null.

3. Overload

public static IObservable<TResult> Repeat<TResult>(TResult value, int repeatCount)

Summary: Generates an observable sequence that repeats the given element the specified number of times.

Type parameters

NameDescription
TResultThe type of the element that will be repeated in the produced sequence.

Parameters

NameTypeDescription
valueTResultElement to repeat.
repeatCountintNumber of times to repeat the element.

Returns: IObservable -- An observable sequence that repeats the given element the specified number of times.

Exceptions

TypeCondition
System.ArgumentOutOfRangeExceptionrepeatCount is less than zero.

4. Overload

public static IObservable<TResult> Repeat<TResult>(TResult value, int repeatCount, IScheduler scheduler)

Summary: Generates an observable sequence that repeats the given element the specified number of times, using the specified scheduler to send out observer messages.

Type parameters

NameDescription
TResultThe type of the element that will be repeated in the produced sequence.

Parameters

NameTypeDescription
valueTResultElement to repeat.
repeatCountintNumber of times to repeat the element.
scheduler[IScheduler](#Scheduler to run the producer loop on.

Returns: IObservable -- An observable sequence that repeats the given element the specified number of times.

Exceptions

TypeCondition
System.ArgumentOutOfRangeExceptionrepeatCount is less than zero.
System.ArgumentNullExceptionscheduler is null.

5. Overload

public static IObservable<TSource> Repeat<TSource>(this IObservable<TSource> source)

Summary: Repeats the observable sequence indefinitely.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
sourceIObservableObservable sequence to repeat.

Returns: IObservable -- The observable sequence producing the elements of the given sequence repeatedly and sequentially.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource is null.

6. Overload

public static IObservable<TSource> Repeat<TSource>(this IObservable<TSource> source, int repeatCount)

Summary: Repeats the observable sequence a specified number of times.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
sourceIObservableObservable sequence to repeat.
repeatCountintNumber of times to repeat the sequence.

Returns: IObservable -- The observable sequence producing the elements of the given sequence repeatedly.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource is null.
System.ArgumentOutOfRangeExceptionrepeatCount is less than zero.