JsonRpc.InvokeWithCancellationAsync Metodo

Definizione

Overload

InvokeWithCancellationAsync(String, IReadOnlyList<Object>, CancellationToken)

Origine:
JsonRpc.cs
Origine:
JsonRpc.cs
Origine:
JsonRpc.cs
Origine:
JsonRpc.cs
Origine:
JsonRpc.cs
Origine:
JsonRpc.cs
Origine:
JsonRpc.cs

Richiama un determinato metodo 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 essere 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.

Valori restituiti

Attività che viene completata quando viene eseguito il metodo del 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 del 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 dispone di un oggetto di destinazione.

Si applica a

InvokeWithCancellationAsync(String, IReadOnlyList<Object>, IReadOnlyList<Type>, CancellationToken)

Richiama un determinato metodo 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 essere 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.

Valori restituiti

Attività che viene completata con la risposta dal server JSON-RPC.

Si applica a

InvokeWithCancellationAsync<TResult>(String, IReadOnlyList<Object>, CancellationToken)

Origine:
JsonRpc.cs
Origine:
JsonRpc.cs
Origine:
JsonRpc.cs
Origine:
JsonRpc.cs
Origine:
JsonRpc.cs
Origine:
JsonRpc.cs
Origine:
JsonRpc.cs

Richiama un determinato metodo 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 essere 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.

Valori restituiti

Task<TResult>

Attività che viene completata quando il metodo 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 del 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 dispone di un oggetto di destinazione.

Si applica a

InvokeWithCancellationAsync<TResult>(String, IReadOnlyList<Object>, IReadOnlyList<Type>, CancellationToken)

Richiama un determinato metodo 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 essere 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 il modo in cui ogni elemento in arguments è previsto dal server da digitare. 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.

Valori restituiti

Task<TResult>

Attività che viene completata quando il metodo server viene eseguito e restituisce il risultato.

Si applica a