Observable.Multicast<TSource, TResult> Method (IObservable<TSource>, ISubject<TSource, TResult>)

Returns a connectable observable sequence that upon connection causes the source sequence to push results into the specified subject.

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

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Function Multicast(Of TSource, TResult) ( _
    source As IObservable(Of TSource), _
    subject As ISubject(Of TSource, TResult) _
) As IConnectableObservable(Of TResult)
'Usage
Dim source As IObservable(Of TSource)
Dim subject As ISubject(Of TSource, TResult)
Dim returnValue As IConnectableObservable(Of TResult)

returnValue = source.Multicast(subject)
public static IConnectableObservable<TResult> Multicast<TSource, TResult>(
    this IObservable<TSource> source,
    ISubject<TSource, TResult> subject
)
[ExtensionAttribute]
public:
generic<typename TSource, typename TResult>
static IConnectableObservable<TResult>^ Multicast(
    IObservable<TSource>^ source, 
    ISubject<TSource, TResult>^ subject
)
static member Multicast : 
        source:IObservable<'TSource> * 
        subject:ISubject<'TSource, 'TResult> -> IConnectableObservable<'TResult> 
JScript does not support generic types and methods.

Type Parameters

  • TSource
    The type of source.
  • TResult
    The type of result.

Parameters

  • source
    Type: System.IObservable<TSource>
    The source sequence whose elements will be pushed into the specified subject.

Return Value

Type: System.Reactive.Subjects.IConnectableObservable<TResult>
A connectable observable sequence that upon connection causes the source sequence to push results into the specified subject.

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

Reference

Observable Class

Multicast Overload

System.Reactive.Linq Namespace