[ CCode ( type_id = "jsonrpc_client_get_type ()" ) ] [ Version ( since = "3.26" ) ] publicclassClient : Object
A client for JSON-RPC communication
The Client class provides a convenient API to coordinate with a JSON-RPC server. You can provide the underlying [
class@Gio.IOStream] to communicate with allowing you to control the negotiation of how you setup your communications channel. One such method
might be to use a [class@Gio.Subprocess] and communicate over stdin and stdout.
Because JSON-RPC allows for out-of-band notifications from the server to the client, it is important that the consumer of this API calls [
method@Client.close] or [method@Client.close_async] when they no longer need the client. This is because Client
contains an asynchronous read-loop to process incoming messages. Until [method@Client.close] or [method@Client.close_async] have been called,
this read loop will prevent the object from finalizing (being freed).
To make an RPC call, use [method@Client.call] or [method@Client.call_async] and provide the method name and the parameters as a [
struct@GLib.Variant] for call.
It is a programming error to mix synchronous and asynchronous API calls of the Client class.
For synchronous calls, Client will use the thread-default [struct@GLib.MainContext]. If you have special needs here
ensure you've set the context before calling into any Client API.