HubLifetimeManager<THub>.InvokeConnectionAsync<T> Method

Definition

Sends an invocation message to the specified connection and waits for a response.

public virtual System.Threading.Tasks.Task<T> InvokeConnectionAsync<T> (string connectionId, string methodName, object?[] args, System.Threading.CancellationToken cancellationToken);
abstract member InvokeConnectionAsync : string * string * obj[] * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'T>
override this.InvokeConnectionAsync : string * string * obj[] * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'T>
Public Overridable Function InvokeConnectionAsync(Of T) (connectionId As String, methodName As String, args As Object(), cancellationToken As CancellationToken) As Task(Of T)

Type Parameters

T

The type of the response expected.

Parameters

connectionId
String

The connection ID.

methodName
String

The invocation method name.

args
Object[]

The invocation arguments.

cancellationToken
CancellationToken

The token to monitor for cancellation requests. It is recommended to set a max wait for expecting a result.

Returns

Task<T>

The response from the connection.

Applies to