Skip to main content

Module serve_client

Module serve_client 

Source
Expand description

Client side of the graph daemon — connect, or start one and connect.

Every hot graph operation (search, query, traverse, status, ingest, entity and relationship writes) goes through here. There is no embedded fallback: when the daemon cannot be reached and cannot be started, that is a named RecallError::Daemon error, never a silent degradation.

Two escapes exist:

  • [graph] mode = "server" (advanced): the store is an external SurrealDB server, so there is nothing to serialize — requests run in-process.
  • exclusive: admin operations (init, gc, extraction, bulk ingest, …) take an admin lock, stop the daemon and keep the store for themselves; hot operations that arrive meanwhile wait for the lock, and the next one after it is released starts a fresh daemon.

Both ends of the socket check the peer’s uid, and the socket, its directory, the pidfile and the daemon log are all owner-only — see [crate::serve_security].

Constants§

DAEMON_BIN_ENV
Environment override for the binary used to start the daemon. Defaults to the running executable; tests and wrappers set it explicitly.

Functions§

daemon_info
Identity of the running daemon, or None when none is running (or when the store is an external server). Never starts a daemon.
daemon_log_path
Daemon log path for a memory directory.
exclusive
Take exclusive ownership of the store for an admin operation.
execute
Run a hot graph operation, starting the daemon if necessary.
graph_mode
Backend mode from [graph] modeembedded (daemon) or server (direct).
socket_path
Socket path for a memory directory.
stop_daemon
Stop the daemon for this memory directory. Returns whether one was running.