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
Nonewhen 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] mode—embedded(daemon) orserver(direct). - socket_
path - Socket path for a memory directory.
- stop_
daemon - Stop the daemon for this memory directory. Returns whether one was running.