)} ,System.Reactive.Concurrency.IScheduler)} ,System.Func{System.IObservable{--0},System.IObservable{--1}})} ,System.Func{System.IObservable{--0},System.IObservable{--1}},System.Reactive.Concurrency.IScheduler)} ,System.TimeSpan)} ,System.Func{System.IObservable{--0},System.IObservable{--1}},System.TimeSpan)} ,System.TimeSpan,System.Reactive.Concurrency.IScheduler)} ,System.Func{System.IObservable{--0},System.IObservable{--1}},System.TimeSpan,System.Reactive.Concurrency.IScheduler)} ,System.Int32,System.Reactive.Concurrency.IScheduler)} ,System.Func{System.IObservable{--0},System.IObservable{--1}},System.Int32,System.Reactive.Concurrency.IScheduler)} ,System.Int32)} ,System.Func{System.IObservable{--0},System.IObservable{--1}},System.Int32)} ,System.Int32,System.TimeSpan)} ,System.Func{System.IObservable{--0},System.IObservable{--1}},System.Int32,System.TimeSpan)} ,System.Int32,System.TimeSpan,System.Reactive.Concurrency.IScheduler)} ,System.Func{System.IObservable{--0},System.IObservable{--1}},System.Int32,System.TimeSpan,System.Reactive.Concurrency.IScheduler)}
Observable.Replay(IObservable) method¶
Defined in
Type: Observable
Namespace: System.Reactive.Linq
Assembly: System.Reactive.dll
Applies to
netstandard2.0
Overloads¶
- 1.
public static IConnectableObservable<TSource> Replay<TSource>(this IObservable<TSource> source) - 2.
public static IConnectableObservable<TSource> Replay<TSource>(this IObservable<TSource> source, IScheduler scheduler) - 3.
public static IObservable<TResult> Replay<TSource, TResult>(this IObservable<TSource> source, Func<IObservable<TSource>, IObservable<TResult>> selector) - 4.
public static IObservable<TResult> Replay<TSource, TResult>(this IObservable<TSource> source, Func<IObservable<TSource>, IObservable<TResult>> selector, IScheduler scheduler) - 5.
public static IConnectableObservable<TSource> Replay<TSource>(this IObservable<TSource> source, TimeSpan window) - 6.
public static IObservable<TResult> Replay<TSource, TResult>(this IObservable<TSource> source, Func<IObservable<TSource>, IObservable<TResult>> selector, TimeSpan window) - 7.
public static IConnectableObservable<TSource> Replay<TSource>(this IObservable<TSource> source, TimeSpan window, IScheduler scheduler) - 8.
public static IObservable<TResult> Replay<TSource, TResult>(this IObservable<TSource> source, Func<IObservable<TSource>, IObservable<TResult>> selector, TimeSpan window, IScheduler scheduler) - 9.
public static IConnectableObservable<TSource> Replay<TSource>(this IObservable<TSource> source, int bufferSize, IScheduler scheduler) - 10.
public static IObservable<TResult> Replay<TSource, TResult>(this IObservable<TSource> source, Func<IObservable<TSource>, IObservable<TResult>> selector, int bufferSize, IScheduler scheduler) - 11.
public static IConnectableObservable<TSource> Replay<TSource>(this IObservable<TSource> source, int bufferSize) - 12.
public static IObservable<TResult> Replay<TSource, TResult>(this IObservable<TSource> source, Func<IObservable<TSource>, IObservable<TResult>> selector, int bufferSize) - 13.
public static IConnectableObservable<TSource> Replay<TSource>(this IObservable<TSource> source, int bufferSize, TimeSpan window) - 14.
public static IObservable<TResult> Replay<TSource, TResult>(this IObservable<TSource> source, Func<IObservable<TSource>, IObservable<TResult>> selector, int bufferSize, TimeSpan window) - 15.
public static IConnectableObservable<TSource> Replay<TSource>(this IObservable<TSource> source, int bufferSize, TimeSpan window, IScheduler scheduler) - 16.
public static IObservable<TResult> Replay<TSource, TResult>(this IObservable<TSource> source, Func<IObservable<TSource>, IObservable<TResult>> selector, int bufferSize, TimeSpan window, IScheduler scheduler)
1. Overload¶
public static IConnectableObservable<TSource> Replay<TSource>(this IObservable<TSource> source)
Summary: Returns a connectable observable sequence that shares a single subscription to the underlying sequence replaying all notifications. This operator is a specialization of Multicast using a ReplaySubject.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | Source sequence whose elements will be multicasted through a single shared subscription. |
Returns: IConnectableObservable
Remarks
Subscribers will receive all the notifications of the source.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source is null. |
See also
2. Overload¶
public static IConnectableObservable<TSource> Replay<TSource>(this IObservable<TSource> source, IScheduler scheduler)
Summary: Returns a connectable observable sequence that shares a single subscription to the underlying sequence replaying all notifications. This operator is a specialization of Multicast using a ReplaySubject.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | Source sequence whose elements will be multicasted through a single shared subscription. |
scheduler | [IScheduler](# | Scheduler where connected observers will be invoked on. |
Returns: IConnectableObservable
Remarks
Subscribers will receive all the notifications of the source.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or scheduler is null. |
See also
3. Overload¶
public static IObservable<TResult> Replay<TSource, TResult>(this IObservable<TSource> source, Func<IObservable<TSource>, IObservable<TResult>> selector)
Summary: Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence replaying all notifications. This operator is a specialization of Multicast using a ReplaySubject.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the elements in the result sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | Source sequence whose elements will be multicasted through a single shared subscription. |
selector | Func | Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all the notifications of the source. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or selector is null. |
See also
4. Overload¶
public static IObservable<TResult> Replay<TSource, TResult>(this IObservable<TSource> source, Func<IObservable<TSource>, IObservable<TResult>> selector, IScheduler scheduler)
Summary: Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence replaying all notifications. This operator is a specialization of Multicast using a ReplaySubject.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the elements in the result sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | Source sequence whose elements will be multicasted through a single shared subscription. |
selector | Func | Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all the notifications of the source. |
scheduler | [IScheduler](# | Scheduler where connected observers within the selector function will be invoked on. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or selector or scheduler is null. |
See also
5. Overload¶
public static IConnectableObservable<TSource> Replay<TSource>(this IObservable<TSource> source, TimeSpan window)
Summary: Returns a connectable observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length for the replay buffer. This operator is a specialization of Multicast using a ReplaySubject.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | Source sequence whose elements will be multicasted through a single shared subscription. |
window | TimeSpan | Maximum time length of the replay buffer. |
Returns: IConnectableObservable
Remarks
Subscribers will receive all the notifications of the source subject to the specified replay buffer trimming policy.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source is null. |
| System.ArgumentOutOfRangeException | window is less than TimeSpan.Zero. |
See also
6. Overload¶
public static IObservable<TResult> Replay<TSource, TResult>(this IObservable<TSource> source, Func<IObservable<TSource>, IObservable<TResult>> selector, TimeSpan window)
Summary: Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length for the replay buffer. This operator is a specialization of Multicast using a ReplaySubject.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the elements in the result sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | Source sequence whose elements will be multicasted through a single shared subscription. |
selector | Func | Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all the notifications of the source subject to the specified replay buffer trimming policy. |
window | TimeSpan | Maximum time length of the replay buffer. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or selector is null. |
| System.ArgumentOutOfRangeException | window is less than TimeSpan.Zero. |
See also
7. Overload¶
public static IConnectableObservable<TSource> Replay<TSource>(this IObservable<TSource> source, TimeSpan window, IScheduler scheduler)
Summary: Returns a connectable observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length for the replay buffer. This operator is a specialization of Multicast using a ReplaySubject.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | Source sequence whose elements will be multicasted through a single shared subscription. |
window | TimeSpan | Maximum time length of the replay buffer. |
scheduler | [IScheduler](# | Scheduler where connected observers will be invoked on. |
Returns: IConnectableObservable
Remarks
Subscribers will receive all the notifications of the source subject to the specified replay buffer trimming policy.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or scheduler is null. |
| System.ArgumentOutOfRangeException | window is less than TimeSpan.Zero. |
See also
8. Overload¶
public static IObservable<TResult> Replay<TSource, TResult>(this IObservable<TSource> source, Func<IObservable<TSource>, IObservable<TResult>> selector, TimeSpan window, IScheduler scheduler)
Summary: Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length for the replay buffer. This operator is a specialization of Multicast using a ReplaySubject.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the elements in the result sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | Source sequence whose elements will be multicasted through a single shared subscription. |
selector | Func | Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all the notifications of the source subject to the specified replay buffer trimming policy. |
window | TimeSpan | Maximum time length of the replay buffer. |
scheduler | [IScheduler](# | Scheduler where connected observers within the selector function will be invoked on. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or selector or scheduler is null. |
| System.ArgumentOutOfRangeException | window is less than TimeSpan.Zero. |
See also
9. Overload¶
public static IConnectableObservable<TSource> Replay<TSource>(this IObservable<TSource> source, int bufferSize, IScheduler scheduler)
Summary: Returns a connectable observable sequence that shares a single subscription to the underlying sequence replaying bufferSize notifications. This operator is a specialization of Multicast using a ReplaySubject.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | Source sequence whose elements will be multicasted through a single shared subscription. |
bufferSize | int | Maximum element count of the replay buffer. |
scheduler | [IScheduler](# | Scheduler where connected observers will be invoked on. |
Returns: IConnectableObservable
Remarks
Subscribers will receive all the notifications of the source subject to the specified replay buffer trimming policy.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or scheduler is null. |
| System.ArgumentOutOfRangeException | bufferSize is less than zero. |
See also
10. Overload¶
public static IObservable<TResult> Replay<TSource, TResult>(this IObservable<TSource> source, Func<IObservable<TSource>, IObservable<TResult>> selector, int bufferSize, IScheduler scheduler)
Summary: Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum element count for the replay buffer. This operator is a specialization of Multicast using a ReplaySubject.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the elements in the result sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | Source sequence whose elements will be multicasted through a single shared subscription. |
selector | Func | Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all the notifications of the source subject to the specified replay buffer trimming policy. |
bufferSize | int | Maximum element count of the replay buffer. |
scheduler | [IScheduler](# | Scheduler where connected observers within the selector function will be invoked on. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or selector or scheduler is null. |
| System.ArgumentOutOfRangeException | bufferSize is less than zero. |
See also
11. Overload¶
public static IConnectableObservable<TSource> Replay<TSource>(this IObservable<TSource> source, int bufferSize)
Summary: Returns a connectable observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum element count for the replay buffer. This operator is a specialization of Multicast using a ReplaySubject.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | Source sequence whose elements will be multicasted through a single shared subscription. |
bufferSize | int | Maximum element count of the replay buffer. |
Returns: IConnectableObservable
Remarks
Subscribers will receive all the notifications of the source subject to the specified replay buffer trimming policy.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source is null. |
| System.ArgumentOutOfRangeException | bufferSize is less than zero. |
See also
12. Overload¶
public static IObservable<TResult> Replay<TSource, TResult>(this IObservable<TSource> source, Func<IObservable<TSource>, IObservable<TResult>> selector, int bufferSize)
Summary: Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum element count for the replay buffer. This operator is a specialization of Multicast using a ReplaySubject.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the elements in the result sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | Source sequence whose elements will be multicasted through a single shared subscription. |
selector | Func | Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all the notifications of the source subject to the specified replay buffer trimming policy. |
bufferSize | int | Maximum element count of the replay buffer. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or selector is null. |
| System.ArgumentOutOfRangeException | bufferSize is less than zero. |
See also
13. Overload¶
public static IConnectableObservable<TSource> Replay<TSource>(this IObservable<TSource> source, int bufferSize, TimeSpan window)
Summary: Returns a connectable observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length and element count for the replay buffer. This operator is a specialization of Multicast using a ReplaySubject.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | Source sequence whose elements will be multicasted through a single shared subscription. |
bufferSize | int | Maximum element count of the replay buffer. |
window | TimeSpan | Maximum time length of the replay buffer. |
Returns: IConnectableObservable
Remarks
Subscribers will receive all the notifications of the source subject to the specified replay buffer trimming policy.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source is null. |
| System.ArgumentOutOfRangeException | bufferSize is less than zero. |
| System.ArgumentOutOfRangeException | window is less than TimeSpan.Zero. |
See also
14. Overload¶
public static IObservable<TResult> Replay<TSource, TResult>(this IObservable<TSource> source, Func<IObservable<TSource>, IObservable<TResult>> selector, int bufferSize, TimeSpan window)
Summary: Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length and element count for the replay buffer. This operator is a specialization of Multicast using a ReplaySubject.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the elements in the result sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | Source sequence whose elements will be multicasted through a single shared subscription. |
selector | Func | Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all the notifications of the source subject to the specified replay buffer trimming policy. |
bufferSize | int | Maximum element count of the replay buffer. |
window | TimeSpan | Maximum time length of the replay buffer. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or selector is null. |
| System.ArgumentOutOfRangeException | bufferSize is less than zero. |
| System.ArgumentOutOfRangeException | window is less than TimeSpan.Zero. |
See also
15. Overload¶
public static IConnectableObservable<TSource> Replay<TSource>(this IObservable<TSource> source, int bufferSize, TimeSpan window, IScheduler scheduler)
Summary: Returns a connectable observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length and element count for the replay buffer. This operator is a specialization of Multicast using a ReplaySubject.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | Source sequence whose elements will be multicasted through a single shared subscription. |
bufferSize | int | Maximum element count of the replay buffer. |
window | TimeSpan | Maximum time length of the replay buffer. |
scheduler | [IScheduler](# | Scheduler where connected observers will be invoked on. |
Returns: IConnectableObservable
Remarks
Subscribers will receive all the notifications of the source subject to the specified replay buffer trimming policy.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or scheduler is null. |
| System.ArgumentOutOfRangeException | bufferSize is less than zero. |
| System.ArgumentOutOfRangeException | window is less than TimeSpan.Zero. |
See also
16. Overload¶
public static IObservable<TResult> Replay<TSource, TResult>(this IObservable<TSource> source, Func<IObservable<TSource>, IObservable<TResult>> selector, int bufferSize, TimeSpan window, IScheduler scheduler)
Summary: Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length and element count for the replay buffer. This operator is a specialization of Multicast using a ReplaySubject.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the elements in the result sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | Source sequence whose elements will be multicasted through a single shared subscription. |
selector | Func | Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all the notifications of the source subject to the specified replay buffer trimming policy. |
bufferSize | int | Maximum element count of the replay buffer. |
window | TimeSpan | Maximum time length of the replay buffer. |
scheduler | [IScheduler](# | Scheduler where connected observers within the selector function will be invoked on. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or selector or scheduler is null. |
| System.ArgumentOutOfRangeException | bufferSize is less than zero. |
| System.ArgumentOutOfRangeException | window is less than TimeSpan.Zero. |
See also