Observable.Sample<TSource> Method (IObservable<TSource>, TimeSpan, IScheduler)

Samples the observable sequence at each interval with the specified source, interval and scheduler.

Namespace:  System.Reactive.Linq
Assembly:  System.Reactive (in System.Reactive.dll)


<ExtensionAttribute> _
Public Shared Function Sample(Of TSource) ( _
    source As IObservable(Of TSource), _
    interval As TimeSpan, _
    scheduler As IScheduler _
) As IObservable(Of TSource)
Dim source As IObservable(Of TSource)
Dim interval As TimeSpan
Dim scheduler As IScheduler
Dim returnValue As IObservable(Of TSource)

returnValue = source.Sample(interval, _
public static IObservable<TSource> Sample<TSource>(
    this IObservable<TSource> source,
    TimeSpan interval,
    IScheduler scheduler
generic<typename TSource>
static IObservable<TSource>^ Sample(
    IObservable<TSource>^ source, 
    TimeSpan interval, 
    IScheduler^ scheduler
static member Sample : 
        source:IObservable<'TSource> * 
        interval:TimeSpan * 
        scheduler:IScheduler -> IObservable<'TSource> 
JScript does not support generic types and methods.

Type Parameters

  • TSource
    The type of source.


Return Value

Type: System.IObservable<TSource>
The sampled observable sequence.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IObservable<TSource>. When you use instance method syntax to call this method, omit the first parameter. For more information, see or .

See Also


Observable Class

Sample Overload

System.Reactive.Linq Namespace