JsonRpc.InvokeWithCancellationAsync Metodo
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Overload
InvokeWithCancellationAsync(String, IReadOnlyList<Object>, IReadOnlyList<Type>, CancellationToken) |
Richiama un metodo specifico in un server JSON-RPC. |
InvokeWithCancellationAsync(String, IReadOnlyList<Object>, CancellationToken) |
Richiama un metodo specifico in un server JSON-RPC. |
InvokeWithCancellationAsync<TResult>(String, IReadOnlyList<Object>, CancellationToken) |
Richiama un metodo specifico in un server JSON-RPC. |
InvokeWithCancellationAsync<TResult>(String, IReadOnlyList<Object>, IReadOnlyList<Type>, CancellationToken) |
Richiama un metodo specifico in un server JSON-RPC. |
InvokeWithCancellationAsync(String, IReadOnlyList<Object>, IReadOnlyList<Type>, CancellationToken)
Richiama un metodo specifico in un server JSON-RPC.
public System.Threading.Tasks.Task InvokeWithCancellationAsync (string targetName, System.Collections.Generic.IReadOnlyList<object?>? arguments, System.Collections.Generic.IReadOnlyList<Type> argumentDeclaredTypes, System.Threading.CancellationToken cancellationToken);
member this.InvokeWithCancellationAsync : string * System.Collections.Generic.IReadOnlyList<obj> * System.Collections.Generic.IReadOnlyList<Type> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function InvokeWithCancellationAsync (targetName As String, arguments As IReadOnlyList(Of Object), argumentDeclaredTypes As IReadOnlyList(Of Type), cancellationToken As CancellationToken) As Task
Parametri
- targetName
- String
Nome del metodo da richiamare. Non deve esser null o vuoto.
- arguments
- IReadOnlyList<Object>
Argomenti da passare al metodo richiamato. Devono essere serializzabili usando l'oggetto selezionato IJsonRpcMessageFormatter. Se null
, non vengono passati argomenti.
- argumentDeclaredTypes
- IReadOnlyList<Type>
- cancellationToken
- CancellationToken
Token il cui annullamento deve segnalare al server di interrompere l'elaborazione della richiesta.
Restituisce
Attività che viene completata con la risposta dal server JSON-RPC.
Si applica a
InvokeWithCancellationAsync(String, IReadOnlyList<Object>, CancellationToken)
Richiama un metodo specifico in un server JSON-RPC.
public System.Threading.Tasks.Task InvokeWithCancellationAsync (string targetName, System.Collections.Generic.IReadOnlyList<object> arguments = default, System.Threading.CancellationToken cancellationToken = default);
public System.Threading.Tasks.Task InvokeWithCancellationAsync (string targetName, System.Collections.Generic.IReadOnlyList<object?>? arguments = default, System.Threading.CancellationToken cancellationToken = default);
member this.InvokeWithCancellationAsync : string * System.Collections.Generic.IReadOnlyList<obj> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function InvokeWithCancellationAsync (targetName As String, Optional arguments As IReadOnlyList(Of Object) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task
Parametri
- targetName
- String
Nome del metodo da richiamare. Non deve esser null o vuoto.
- arguments
- IReadOnlyList<Object>
Argomenti da passare al metodo richiamato. Devono essere serializzabili usando l'oggetto selezionato IJsonRpcMessageFormatter. Se null
, non vengono passati argomenti.
- cancellationToken
- CancellationToken
Token il cui annullamento deve segnalare al server di interrompere l'elaborazione della richiesta.
Restituisce
Attività che viene completata quando viene eseguito il metodo server.
Eccezioni
L'attività result ha esito negativo con questa eccezione se il canale di comunicazione termina prima che il risultato venga restituito dal server o in risposta all'annullamento cancellationToken
.
L'attività result ha esito negativo con questa eccezione se il metodo server genera un'eccezione, che può verificarsi in risposta all'annullamento cancellationToken
.
L'attività result ha esito negativo con questa eccezione se il targetName
metodo non è stato registrato nel server.
Se targetName
è Null.
Se questa istanza di JsonRpc è stata eliminata.
L'attività result ha esito negativo con questa eccezione se il server non ha alcun oggetto di destinazione.
Si applica a
InvokeWithCancellationAsync<TResult>(String, IReadOnlyList<Object>, CancellationToken)
Richiama un metodo specifico in un server JSON-RPC.
public System.Threading.Tasks.Task<TResult> InvokeWithCancellationAsync<TResult> (string targetName, System.Collections.Generic.IReadOnlyList<object> arguments = default, System.Threading.CancellationToken cancellationToken = default);
public System.Threading.Tasks.Task<TResult> InvokeWithCancellationAsync<TResult> (string targetName, System.Collections.Generic.IReadOnlyList<object?>? arguments = default, System.Threading.CancellationToken cancellationToken = default);
member this.InvokeWithCancellationAsync : string * System.Collections.Generic.IReadOnlyList<obj> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Result>
Public Function InvokeWithCancellationAsync(Of TResult) (targetName As String, Optional arguments As IReadOnlyList(Of Object) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of TResult)
Parametri di tipo
- TResult
Tipo del risultato del metodo.
Parametri
- targetName
- String
Nome del metodo da richiamare. Non deve esser null o vuoto.
- arguments
- IReadOnlyList<Object>
Argomenti da passare al metodo richiamato. Devono essere serializzabili usando l'oggetto selezionato IJsonRpcMessageFormatter. Se null
, non vengono passati argomenti.
- cancellationToken
- CancellationToken
Token il cui annullamento deve segnalare al server di interrompere l'elaborazione della richiesta.
Restituisce
Attività che viene completata quando il metodo del server viene eseguito e restituisce il risultato.
Eccezioni
L'attività result ha esito negativo con questa eccezione se il canale di comunicazione termina prima che il risultato venga restituito dal server o in risposta all'annullamento cancellationToken
.
L'attività result ha esito negativo con questa eccezione se il metodo server genera un'eccezione, che può verificarsi in risposta all'annullamento cancellationToken
.
L'attività result ha esito negativo con questa eccezione se il targetName
metodo non è stato registrato nel server.
Se targetName
è Null.
Se questa istanza di JsonRpc è stata eliminata.
L'attività result ha esito negativo con questa eccezione se il server non ha alcun oggetto di destinazione.
Si applica a
InvokeWithCancellationAsync<TResult>(String, IReadOnlyList<Object>, IReadOnlyList<Type>, CancellationToken)
Richiama un metodo specifico in un server JSON-RPC.
public System.Threading.Tasks.Task<TResult> InvokeWithCancellationAsync<TResult> (string targetName, System.Collections.Generic.IReadOnlyList<object?>? arguments, System.Collections.Generic.IReadOnlyList<Type>? argumentDeclaredTypes, System.Threading.CancellationToken cancellationToken);
member this.InvokeWithCancellationAsync : string * System.Collections.Generic.IReadOnlyList<obj> * System.Collections.Generic.IReadOnlyList<Type> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Result>
Public Function InvokeWithCancellationAsync(Of TResult) (targetName As String, arguments As IReadOnlyList(Of Object), argumentDeclaredTypes As IReadOnlyList(Of Type), cancellationToken As CancellationToken) As Task(Of TResult)
Parametri di tipo
- TResult
Tipo del risultato del metodo.
Parametri
- targetName
- String
Nome del metodo da richiamare. Non deve esser null o vuoto.
- arguments
- IReadOnlyList<Object>
Argomenti da passare al metodo richiamato. Devono essere serializzabili usando l'oggetto selezionato IJsonRpcMessageFormatter. Se null
, non vengono passati argomenti.
- argumentDeclaredTypes
- IReadOnlyList<Type>
Elenco di Type oggetti che descrivono la modalità di digitazione di ogni elemento in arguments
dal server.
Se specificato, deve avere esattamente la stessa lunghezza di arguments
e non null
contenere elementi.
Questo valore viene ignorato quando isParameterObject
è true.
- cancellationToken
- CancellationToken
Token il cui annullamento deve segnalare al server di interrompere l'elaborazione della richiesta.
Restituisce
Attività che viene completata quando il metodo del server viene eseguito e restituisce il risultato.