#json-rpc #run-time #json-rpc-client #stream #byte #notifications #back-end

thin-jsonrpc-client

A lightweight, runtime agnostic JSON-RPC client

2 unstable releases

0.1.0 Aug 6, 2023
0.0.1 Aug 1, 2023

#1090 in Hardware support

MIT license

48KB
918 lines

thin-jsonrpc-client

A lightweight wrapper around something that can send bytes and something that can hand them back which implements the JSON-RPC specification. The main goals of this are:

  • To be backend independent; use whichever Websocket (or other) library you prefer.
  • To be async runtime independent; use whatever you prefer.
  • To support backpressure. You're handed back a "driver" which must be polled to drive receipt of messages; this can react to the messages (or errors) that come back, and rate limit by polling less frequently. Or, you can just run it in a task and forget about it if you don't care.
  • To make it easy to access streams of server notifications (messages without ids attached). This streams can be used to build higher level logic on top, like handling for subscriptions and such.

lib.rs:

thin-jsonrpc-client

This crate provides a lightweight JSON-RPC compatible client.

Dependencies

~1.3–2.4MB
~49K SLoC