Aracılığıyla paylaş


JsonRpc.DispatchRequestAsync Yöntem

Tanım

Yerel RPC hedef nesnesinde yöntemini çağırır ve yanıtı bir JSON-RPC sonuç iletisine dönüştürür.

protected virtual System.Threading.Tasks.ValueTask<StreamJsonRpc.Protocol.JsonRpcMessage> DispatchRequestAsync (StreamJsonRpc.Protocol.JsonRpcRequest request, StreamJsonRpc.TargetMethod targetMethod, System.Threading.CancellationToken cancellationToken);
abstract member DispatchRequestAsync : StreamJsonRpc.Protocol.JsonRpcRequest * StreamJsonRpc.TargetMethod * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<StreamJsonRpc.Protocol.JsonRpcMessage>
override this.DispatchRequestAsync : StreamJsonRpc.Protocol.JsonRpcRequest * StreamJsonRpc.TargetMethod * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<StreamJsonRpc.Protocol.JsonRpcMessage>
Protected Overridable Function DispatchRequestAsync (request As JsonRpcRequest, targetMethod As TargetMethod, cancellationToken As CancellationToken) As ValueTask(Of JsonRpcMessage)

Parametreler

request
JsonRpcRequest

Gönderimi almak için seçilmesiyle targetMethod sonuçlanan gelen JSON-RPC isteği.

targetMethod
TargetMethod

Çağrılacak yöntem ve ona geçirilecek bağımsız değişkenler.

cancellationToken
CancellationToken

öğesine geçirilirken StreamJsonRpc.TargetMethod.InvokeAsync(System.Threading.CancellationToken)bir iptal belirteci.

Döndürülenler

İstemciye geri gönderilecek JSON-RPC yanıt iletisi. Bunun hiçbir zaman null olması beklenmez. Protokol istemci tarafından herhangi bir yanıt iletisi beklenmediğini gösteriyorsa iletilmeyecek şekilde bırakılır.

Açıklamalar

Bu yöntemin geçersiz kılmalarının çekirdek işlevsellik için bu temel yöntemi çağırması beklenir. Geçersiz kılmanın amacı özellikle gelen iletilerin sırasını değiştirmek olmadığı sürece tutarlı ileti sıralamasını korumak için, geçersiz kılmalar herhangi bir sonuç beklemeden önce temel yöntemi çağırmalıdır.

Şunlara uygulanır