JsonRpc.NotifyAsync Method

Definition

Overloads

NotifyAsync(String, Object)

Invokes a given method on a JSON-RPC server without waiting for its response.

NotifyAsync(String, Object[])

Invoke a method on the server and don't wait for its completion, fire-and-forget style.

NotifyAsync(String, Object[], IReadOnlyList<Type>)

Invokes a given method on a JSON-RPC server without waiting for its response.

NotifyAsync(String, Object)

Invokes a given method on a JSON-RPC server without waiting for its response.

public System.Threading.Tasks.Task NotifyAsync (string targetName, object argument);
public System.Threading.Tasks.Task NotifyAsync (string targetName, object? argument);
member this.NotifyAsync : string * obj -> System.Threading.Tasks.Task
Public Function NotifyAsync (targetName As String, argument As Object) As Task

Parameters

targetName
String

Name of the method to invoke. Must not be null or empty.

argument
Object

Method argument, must be serializable using the selected IJsonRpcMessageFormatter.

Returns

A task that completes when the notify request is sent to the channel to the server.

Exceptions

If targetName is null.

Thrown when targetName is empty.

If this instance of JsonRpc has already been disposed prior to this call.

Thrown when the connection is terminated (by either side) while the request is being transmitted.

Any exception thrown by the IJsonRpcMessageFormatter (typically due to serialization failures). When using JsonMessageFormatter this should be Newtonsoft.Json.JsonSerializationException. When using MessagePackFormatter this should be MessagePack.MessagePackSerializationException.

Remarks

Any error that happens on the server side is ignored.

Applies to

NotifyAsync(String, Object[])

Invoke a method on the server and don't wait for its completion, fire-and-forget style.

public System.Threading.Tasks.Task NotifyAsync (string targetName, params object[] arguments);
public System.Threading.Tasks.Task NotifyAsync (string targetName, params object?[]? arguments);
member this.NotifyAsync : string * obj[] -> System.Threading.Tasks.Task
Public Function NotifyAsync (targetName As String, ParamArray arguments As Object()) As Task

Parameters

targetName
String

The name of the method to invoke on the server. Must not be null or empty string.

arguments
Object[]

Method arguments, must be serializable to JSON.

Returns

A task that completes when the notify request is sent to the channel to the server.

Exceptions

If targetName is null.

If this instance of JsonRpc has been disposed.

Remarks

Any error that happens on the server side is ignored.

Applies to

NotifyAsync(String, Object[], IReadOnlyList<Type>)

Invokes a given method on a JSON-RPC server without waiting for its response.

public System.Threading.Tasks.Task NotifyAsync (string targetName, object?[]? arguments, System.Collections.Generic.IReadOnlyList<Type>? argumentDeclaredTypes);
member this.NotifyAsync : string * obj[] * System.Collections.Generic.IReadOnlyList<Type> -> System.Threading.Tasks.Task
Public Function NotifyAsync (targetName As String, arguments As Object(), argumentDeclaredTypes As IReadOnlyList(Of Type)) As Task

Parameters

targetName
String

Name of the method to invoke. Must not be null or empty.

arguments
Object[]

Arguments to pass to the invoked method. They must be serializable using the selected IJsonRpcMessageFormatter. If null, no arguments are passed.

argumentDeclaredTypes
IReadOnlyList<Type>

A list of Type objects that describe how each element in arguments is expected by the server to be typed. If specified, this must have exactly the same length as arguments and contain no null elements. This value is ignored when isParameterObject is true.

Returns

A task that completes when the notify request is sent to the channel to the server.

Remarks

Any error that happens on the server side is ignored.

Applies to