Skip to main content

Module rpc_client

Module rpc_client 

Source
Expand description

Thin JSON-RPC client to talk to the running Scrybe GUI.

Connects to the Unix-domain socket at ~/.scrybe/sock (or $SCRYBE_SOCK), sends a single request, returns the response. One request per connection keeps the client trivially correct.

try_connect returns None for the two “GUI not running” outcomes (file missing or connect refused). Callers branch on that to either fall through to launch-app or silent-no-op semantics, per the design.

Functions§

send
Send a single request to the default socket path.
send_to
Send a single request to an explicit socket path. Tests use this.
socket_path
Resolved socket path the client uses by default (used for diagnostics).
try_connect
Try to connect to the Scrybe socket at the default location. Ok(Some(_)) = live server, Ok(None) = no server running, Err(_) = something else went wrong (e.g. permission denied).
try_connect_at
Try to connect at an explicit socket path. Tests use this to avoid the SCRYBE_SOCK env-var race when running in parallel.