返回一个可连接的可观察序列,该序列与在窗口中重播所有通知的基础序列共享单个订阅。
Namespace:System.Reactive.Linq
装配: System.Reactive.dll) 中的 System.Reactive (
语法
'Declaration
<ExtensionAttribute> _
Public Shared Function Replay(Of TSource) ( _
source As IObservable(Of TSource), _
window As TimeSpan _
) As IConnectableObservable(Of TSource)
'Usage
Dim source As IObservable(Of TSource)
Dim window As TimeSpan
Dim returnValue As IConnectableObservable(Of TSource)
returnValue = source.Replay(window)
public static IConnectableObservable<TSource> Replay<TSource>(
this IObservable<TSource> source,
TimeSpan window
)
[ExtensionAttribute]
public:
generic<typename TSource>
static IConnectableObservable<TSource>^ Replay(
IObservable<TSource>^ source,
TimeSpan window
)
static member Replay :
source:IObservable<'TSource> *
window:TimeSpan -> IConnectableObservable<'TSource>
JScript does not support generic types and methods.
类型参数
- TSource
源的类型。
parameters
- source
类型: System.IObservable<TSource>
其元素将通过单个共享订阅进行多播的源序列。
- window
类型: System.TimeSpan
重播缓冲区的最大时间长度。
返回值
类型: System.Reactive.Subjects.IConnectableObservable<TSource>
与基础序列共享单个订阅的可连接可观察序列。
使用说明
在 Visual Basic 和 C# 中,可以在 IObservable<TSource> 类型的任何对象上调用此方法作为实例方法。 当使用实例方法语法调用此方法时,请省略第一个参数。 有关详细信息,请参阅或。