weywot/backend
Dustin 96ede2a407 backend: web: Begin JSON-RPC client impl
Starting work on the JSON-RPC client in the web server.

The `Context` structure, which is stored in Rocket's managed state and
available to route functions through the `State` request guard, provides
a method to get an RPC client.  Each request that needs to communicate
with the daemon will have its own RPC connection.  This ensures that a
valid connection is always available, even if the daemon has restarted
between web requests.  I had considered storing the connection in the
context, testing it each time it was needed, and reconnecting if the
connection was broken.  This proved very difficult, since the context is
passed to request handlers as an immutable reference.  Mutating its
state would require locking, and I could not make that work easily.
Besides, the overhead of "pinging" the server for every request is
probably greater than just reconnecting every time, so it would have
been a waste.

The *GET /status* operation returns a document that indicates the status
of the daemon and the web server.
2022-01-09 14:58:59 -06:00
..
src backend: web: Begin JSON-RPC client impl 2022-01-09 14:58:59 -06:00
.gitignore backend: Begin server process work 2022-01-08 17:28:42 -06:00
Cargo.lock backend: web: Begin JSON-RPC client impl 2022-01-09 14:58:59 -06:00
Cargo.toml backend: web: Begin JSON-RPC client impl 2022-01-09 14:58:59 -06:00
rustfmt.toml backend: Begin server process work 2022-01-08 17:28:42 -06:00