JsonRpc::Client
Client class for JSON-RPC. See one of its sub-classes for implementations.
The client offers a built-in flood-protection for received messages. Note that these are counted towards all messages, and thus include responses to made remote invocations from our end.
By default, the flood-protection allows for 6000 messages per minute, or
about 100 messages per second. You can change these values through
#flood_time_span and #flood_messages.
Constructors
Instance methods
If true, all locally invoked methods will be run in their own fiber.
Calls a remote method with optional params, returning a result_type.
Error behaviour
On success the result of the invocation is returned. If however the
remote signals an error through the "error" field (per JSON-RPC), it
will be re-raised locally as RemoteCallError.
See #call? for a non-raising version.
Calls a remote method, returning the result. On error, a
RemoteCallError is returned. Otherwise, the nilable result is
returned.
Count of max messages in #flood_time_span, after which the flood
protection is triggered.
Set to nil to disable the flood-protection.
Count of max messages in #flood_time_span, after which the flood
protection is triggered.
Set to nil to disable the flood-protection.
Time span in which a max count of #flood_messages messages can be
received before triggering the flood protection.
Time span in which a max count of #flood_messages messages can be
received before triggering the flood protection.
Handler which is called whenever a call is received from the remote end. The default implementation rejects every call immediately.
See also Handler#call.
Handler which is called whenever a call is received from the remote end. The default implementation rejects every call immediately.
See also Handler#call.
Called by Client implementations to invoke a local method.
Sends a notification to method with params to the remote end.
Sends a notification to the remote end, that is already serialized. Useful to send a notification to many clients in bulk.
Use Request#to_json for easy construction of a message.
If the client is currently running, accepting messages, and hopefully also still connected.