Skip to content

)} ,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

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
sourceIObservableSource sequence whose elements will be multicasted through a single shared subscription.

Returns: IConnectableObservable -- A connectable observable sequence that shares a single subscription to the underlying sequence.

Remarks

Subscribers will receive all the notifications of the source.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource 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

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
sourceIObservableSource sequence whose elements will be multicasted through a single shared subscription.
scheduler[IScheduler](#Scheduler where connected observers will be invoked on.

Returns: IConnectableObservable -- A connectable observable sequence that shares a single subscription to the underlying sequence.

Remarks

Subscribers will receive all the notifications of the source.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource 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

NameDescription
TSourceThe type of the elements in the source sequence.
TResultThe type of the elements in the result sequence.

Parameters

NameTypeDescription
sourceIObservableSource sequence whose elements will be multicasted through a single shared subscription.
selectorFunc, IObservable>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 -- An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource 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

NameDescription
TSourceThe type of the elements in the source sequence.
TResultThe type of the elements in the result sequence.

Parameters

NameTypeDescription
sourceIObservableSource sequence whose elements will be multicasted through a single shared subscription.
selectorFunc, IObservable>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 -- An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource 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

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
sourceIObservableSource sequence whose elements will be multicasted through a single shared subscription.
windowTimeSpanMaximum time length of the replay buffer.

Returns: IConnectableObservable -- A connectable observable sequence that shares a single subscription to the underlying sequence.

Remarks

Subscribers will receive all the notifications of the source subject to the specified replay buffer trimming policy.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource is null.
System.ArgumentOutOfRangeExceptionwindow 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

NameDescription
TSourceThe type of the elements in the source sequence.
TResultThe type of the elements in the result sequence.

Parameters

NameTypeDescription
sourceIObservableSource sequence whose elements will be multicasted through a single shared subscription.
selectorFunc, IObservable>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.
windowTimeSpanMaximum time length of the replay buffer.

Returns: IObservable -- An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or selector is null.
System.ArgumentOutOfRangeExceptionwindow 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

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
sourceIObservableSource sequence whose elements will be multicasted through a single shared subscription.
windowTimeSpanMaximum time length of the replay buffer.
scheduler[IScheduler](#Scheduler where connected observers will be invoked on.

Returns: IConnectableObservable -- A connectable observable sequence that shares a single subscription to the underlying sequence.

Remarks

Subscribers will receive all the notifications of the source subject to the specified replay buffer trimming policy.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or scheduler is null.
System.ArgumentOutOfRangeExceptionwindow 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

NameDescription
TSourceThe type of the elements in the source sequence.
TResultThe type of the elements in the result sequence.

Parameters

NameTypeDescription
sourceIObservableSource sequence whose elements will be multicasted through a single shared subscription.
selectorFunc, IObservable>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.
windowTimeSpanMaximum time length of the replay buffer.
scheduler[IScheduler](#Scheduler where connected observers within the selector function will be invoked on.

Returns: IObservable -- An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or selector or scheduler is null.
System.ArgumentOutOfRangeExceptionwindow 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

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
sourceIObservableSource sequence whose elements will be multicasted through a single shared subscription.
bufferSizeintMaximum element count of the replay buffer.
scheduler[IScheduler](#Scheduler where connected observers will be invoked on.

Returns: IConnectableObservable -- A connectable observable sequence that shares a single subscription to the underlying sequence.

Remarks

Subscribers will receive all the notifications of the source subject to the specified replay buffer trimming policy.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or scheduler is null.
System.ArgumentOutOfRangeExceptionbufferSize 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

NameDescription
TSourceThe type of the elements in the source sequence.
TResultThe type of the elements in the result sequence.

Parameters

NameTypeDescription
sourceIObservableSource sequence whose elements will be multicasted through a single shared subscription.
selectorFunc, IObservable>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.
bufferSizeintMaximum element count of the replay buffer.
scheduler[IScheduler](#Scheduler where connected observers within the selector function will be invoked on.

Returns: IObservable -- An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or selector or scheduler is null.
System.ArgumentOutOfRangeExceptionbufferSize 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

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
sourceIObservableSource sequence whose elements will be multicasted through a single shared subscription.
bufferSizeintMaximum element count of the replay buffer.

Returns: IConnectableObservable -- A connectable observable sequence that shares a single subscription to the underlying sequence.

Remarks

Subscribers will receive all the notifications of the source subject to the specified replay buffer trimming policy.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource is null.
System.ArgumentOutOfRangeExceptionbufferSize 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

NameDescription
TSourceThe type of the elements in the source sequence.
TResultThe type of the elements in the result sequence.

Parameters

NameTypeDescription
sourceIObservableSource sequence whose elements will be multicasted through a single shared subscription.
selectorFunc, IObservable>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.
bufferSizeintMaximum element count of the replay buffer.

Returns: IObservable -- An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or selector is null.
System.ArgumentOutOfRangeExceptionbufferSize 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

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
sourceIObservableSource sequence whose elements will be multicasted through a single shared subscription.
bufferSizeintMaximum element count of the replay buffer.
windowTimeSpanMaximum time length of the replay buffer.

Returns: IConnectableObservable -- A connectable observable sequence that shares a single subscription to the underlying sequence.

Remarks

Subscribers will receive all the notifications of the source subject to the specified replay buffer trimming policy.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource is null.
System.ArgumentOutOfRangeExceptionbufferSize is less than zero.
System.ArgumentOutOfRangeExceptionwindow 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

NameDescription
TSourceThe type of the elements in the source sequence.
TResultThe type of the elements in the result sequence.

Parameters

NameTypeDescription
sourceIObservableSource sequence whose elements will be multicasted through a single shared subscription.
selectorFunc, IObservable>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.
bufferSizeintMaximum element count of the replay buffer.
windowTimeSpanMaximum time length of the replay buffer.

Returns: IObservable -- An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or selector is null.
System.ArgumentOutOfRangeExceptionbufferSize is less than zero.
System.ArgumentOutOfRangeExceptionwindow 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

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
sourceIObservableSource sequence whose elements will be multicasted through a single shared subscription.
bufferSizeintMaximum element count of the replay buffer.
windowTimeSpanMaximum time length of the replay buffer.
scheduler[IScheduler](#Scheduler where connected observers will be invoked on.

Returns: IConnectableObservable -- A connectable observable sequence that shares a single subscription to the underlying sequence.

Remarks

Subscribers will receive all the notifications of the source subject to the specified replay buffer trimming policy.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or scheduler is null.
System.ArgumentOutOfRangeExceptionbufferSize is less than zero.
System.ArgumentOutOfRangeExceptionwindow 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

NameDescription
TSourceThe type of the elements in the source sequence.
TResultThe type of the elements in the result sequence.

Parameters

NameTypeDescription
sourceIObservableSource sequence whose elements will be multicasted through a single shared subscription.
selectorFunc, IObservable>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.
bufferSizeintMaximum element count of the replay buffer.
windowTimeSpanMaximum time length of the replay buffer.
scheduler[IScheduler](#Scheduler where connected observers within the selector function will be invoked on.

Returns: IObservable -- An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or selector or scheduler is null.
System.ArgumentOutOfRangeExceptionbufferSize is less than zero.
System.ArgumentOutOfRangeExceptionwindow is less than TimeSpan.Zero.

See also