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
| Name | Description |
|---|---|
TResult | The type of the element that will be repeated in the produced sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
value | TResult | Element to repeat. |
Returns: IObservable
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
| Name | Description |
|---|---|
TResult | The type of the element that will be repeated in the produced sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
value | TResult | Element to repeat. |
scheduler | [IScheduler](# | Scheduler to run the producer loop on. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | scheduler 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
| Name | Description |
|---|---|
TResult | The type of the element that will be repeated in the produced sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
value | TResult | Element to repeat. |
repeatCount | int | Number of times to repeat the element. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentOutOfRangeException | repeatCount 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
| Name | Description |
|---|---|
TResult | The type of the element that will be repeated in the produced sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
value | TResult | Element to repeat. |
repeatCount | int | Number of times to repeat the element. |
scheduler | [IScheduler](# | Scheduler to run the producer loop on. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentOutOfRangeException | repeatCount is less than zero. |
| System.ArgumentNullException | scheduler is null. |
5. Overload¶
public static IObservable<TSource> Repeat<TSource>(this IObservable<TSource> source)
Summary: Repeats the observable sequence indefinitely.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | Observable sequence to repeat. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source 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
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | Observable sequence to repeat. |
repeatCount | int | Number of times to repeat the sequence. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source is null. |
| System.ArgumentOutOfRangeException | repeatCount is less than zero. |