Share via


HubConnection.StreamAsChannelCoreAsync Method

Definition

Invokes a streaming hub method on the server using the specified method name, return type and arguments.

public System.Threading.Tasks.Task<System.Threading.Channels.ChannelReader<object>> StreamAsChannelCoreAsync (string methodName, Type returnType, object[] args, System.Threading.CancellationToken cancellationToken = default);
public virtual System.Threading.Tasks.Task<System.Threading.Channels.ChannelReader<object?>> StreamAsChannelCoreAsync (string methodName, Type returnType, object?[] args, System.Threading.CancellationToken cancellationToken = default);
member this.StreamAsChannelCoreAsync : string * Type * obj[] * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Threading.Channels.ChannelReader<obj>>
abstract member StreamAsChannelCoreAsync : string * Type * obj[] * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Threading.Channels.ChannelReader<obj>>
override this.StreamAsChannelCoreAsync : string * Type * obj[] * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Threading.Channels.ChannelReader<obj>>
Public Function StreamAsChannelCoreAsync (methodName As String, returnType As Type, args As Object(), Optional cancellationToken As CancellationToken = Nothing) As Task(Of ChannelReader(Of Object))
Public Overridable Function StreamAsChannelCoreAsync (methodName As String, returnType As Type, args As Object(), Optional cancellationToken As CancellationToken = Nothing) As Task(Of ChannelReader(Of Object))

Parameters

methodName
String

The name of the server method to invoke.

returnType
Type

The return type of the server method.

args
Object[]

The arguments used to invoke the server method.

cancellationToken
CancellationToken

The token to monitor for cancellation requests. The default value is None.

Returns

A Task<TResult> that represents the asynchronous invoke. The Result property returns a ChannelReader<T> for the streamed hub method values.

Remarks

This is a low level method for invoking a streaming hub method on the server. Using an HubConnectionExtensionsStreamAsChannelAsync extension method is recommended.

Applies to