|Home > Generic function call interface > Sending a request, a notification, and a response|
This topic describes typical sequences of steps involved in sending a request, a notification, and a response.
Requests are defined in the JSON RPC 2.0 specification. For more information, see 2.2 JSON-RPC 2.0 function call format.
A request sent by the caller to the callee, and a response sent by the callee to the caller, are equivalent to a function call with a return value. The caller typically takes the following steps to complete a blocking function call:
instId, by calling
instanceRegistry_registerInstance(). Typically, the caller also must have called
instanceRegistry_getList()to find out the id of the instance it is calling.
instId, which is also 32 bits wide, into the top 32 bits of the request id to form the 64-bit request id that is passed with the request. This is required by the global instance to route responses back to the caller.
IrisInterfacethat it is connected to. This is usually provided by
IrisCoreConnectionfor in-process instances or
IrisClientConnectionfor out-of-process instances. This forwards the request to the callee.
irisHandleMessage()function of the
IrisInterfaceof the caller.
In practice, these steps are handled by a support library and the caller is not exposed to them. Requests can be sent from different threads. The caller does not have to wait for a response before sending another request. Requests can overlap. Responses can come from different threads and in any order. The caller must use the request id to match the response to a request.
Notifications are defined in the JSON RPC 2.0 specification. For more information, see 2.2 JSON-RPC 2.0 function call format. Notifications are used, for example, by non-blocking, asynchronous callbacks. Sending a notification differs from sending a request in the following ways:
E_unknown_instance_id, or any low-level I/O error codes from the transport layer. This might limit the usefulness of notifications.
Responses are defined in the JSON RPC 2.0 specification. For more information, see 2.2 JSON-RPC 2.0 function call format. After processing the request, the callee takes the following steps to send a response to the request:
instIdof the caller from the request id of the request.
instIdand the original 64-bit request id.