Observable.Sample(Of TSource, TSample) Method (IObservable(Of TSource), IObservable(Of TSample))

Samples the observable sequence at sampling ticks with the specified source and sampler.

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

<ExtensionAttribute> _
Public Shared Function Sample(Of TSource, TSample) ( _
	source As IObservable(Of TSource), _
	sampler As IObservable(Of TSample) _
) As IObservable(Of TSource)
Dim source As IObservable(Of TSource)
Dim sampler As IObservable(Of TSample)
Dim returnValue As IObservable(Of TSource)

returnValue = source.Sample(sampler)

Type Parameters


The type of source.


The type of sample.


Type: System.IObservable(Of TSource)
The source sequence to sample.
Type: System.IObservable(Of TSample)
The sampling tick sequence.

Return Value

Type: System.IObservable(Of 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(Of TSource). When you use instance method syntax to call this method, omit the first parameter. For more information, see https://msdn.microsoft.com/en-us/library/bb384936(v=vs.103).aspx or https://msdn.microsoft.com/en-us/library/bb383977(v=vs.103).aspx.