Liking cljdoc? Tell your friends :D

hive-emacs.daemon-store

Singleton daemon store for shared access across modules.

Provides a shared IEmacsDaemon store instance that can be accessed from swarm sync, emacsclient, and coordinator modules.

DDD: Infrastructure layer - singleton access to repository.

Singleton daemon store for shared access across modules.

Provides a shared IEmacsDaemon store instance that can be accessed
from swarm sync, emacsclient, and coordinator modules.

DDD: Infrastructure layer - singleton access to repository.
raw docstring

bind-ling!clj

(bind-ling! daemon-id ling-id)

Bind a ling to a daemon. Delegates to IEmacsDaemon.bind-ling!

Bind a ling to a daemon. Delegates to IEmacsDaemon.bind-ling!
sourceraw docstring

cleanup-stale!clj

(cleanup-stale!)
(cleanup-stale! opts)

Cleanup stale daemons. Delegates to IEmacsDaemon.cleanup-stale!

Cleanup stale daemons. Delegates to IEmacsDaemon.cleanup-stale!
sourceraw docstring

default-daemon-idclj

(default-daemon-id)

Get the default daemon ID from environment or use 'server'. This matches the socket name used by emacs-socket-name in emacsclient.clj. Delegates to hive-emacs.config — single source of truth.

Get the default daemon ID from environment or use 'server'.
This matches the socket name used by *emacs-socket-name* in emacsclient.clj.
Delegates to hive-emacs.config — single source of truth.
sourceraw docstring

ensure-default-daemon!clj

(ensure-default-daemon!)

Ensure the default daemon is registered. Call this during system startup to bootstrap daemon tracking.

Returns: Transaction report from register! or nil if already exists

Ensure the default daemon is registered.
Call this during system startup to bootstrap daemon tracking.

Returns:
  Transaction report from register! or nil if already exists
sourceraw docstring

get-all-daemonsclj

(get-all-daemons)

Get all registered daemons. Delegates to IEmacsDaemon.get-all-daemons

Get all registered daemons. Delegates to IEmacsDaemon.get-all-daemons
sourceraw docstring

get-daemonclj

(get-daemon daemon-id)

Get daemon by ID. Delegates to IEmacsDaemon.get-daemon

Get daemon by ID. Delegates to IEmacsDaemon.get-daemon
sourceraw docstring

get-daemon-for-lingclj

(get-daemon-for-ling ling-id)

Find daemon for a ling. Delegates to IEmacsDaemon.get-daemon-for-ling

Find daemon for a ling. Delegates to IEmacsDaemon.get-daemon-for-ling
sourceraw docstring

get-daemons-by-statusclj

(get-daemons-by-status status)

Get daemons by status. Delegates to IEmacsDaemon.get-daemons-by-status

Get daemons by status. Delegates to IEmacsDaemon.get-daemons-by-status
sourceraw docstring

get-storeclj

(get-store)

Get the shared daemon store instance. Lazily initializes on first call.

Returns: IEmacsDaemon implementation (DataScriptDaemonStore)

Get the shared daemon store instance.
Lazily initializes on first call.

Returns:
  IEmacsDaemon implementation (DataScriptDaemonStore)
sourceraw docstring

heal-orphans!clj

(heal-orphans!)

Manually trigger orphan detection and healing. Useful for immediate cleanup outside the heartbeat cycle.

Returns: Map with :orphans-found, :healed, :failed, :results or nil if no orphans found.

Manually trigger orphan detection and healing.
Useful for immediate cleanup outside the heartbeat cycle.

Returns:
  Map with :orphans-found, :healed, :failed, :results
  or nil if no orphans found.
sourceraw docstring

heartbeat!clj

(heartbeat! daemon-id)

Update daemon heartbeat. Delegates to IEmacsDaemon.heartbeat!

Update daemon heartbeat. Delegates to IEmacsDaemon.heartbeat!
sourceraw docstring

heartbeat-statusclj

(heartbeat-status)

Get current heartbeat loop status.

Returns: Map with :running?, :last-heartbeat, :last-cleanup, :daemon-status, :health-score, :health-level (W2 additions), :last-autoheal, :last-autoheal-result (W3 additions), :last-redistribution, :last-redistribution-result (W4 additions)

Get current heartbeat loop status.

Returns:
  Map with :running?, :last-heartbeat, :last-cleanup, :daemon-status,
  :health-score, :health-level (W2 additions),
  :last-autoheal, :last-autoheal-result (W3 additions),
  :last-redistribution, :last-redistribution-result (W4 additions)
sourceraw docstring

mark-error!clj

(mark-error! daemon-id error-message)

Mark daemon as errored. Delegates to IEmacsDaemon.mark-error!

Mark daemon as errored. Delegates to IEmacsDaemon.mark-error!
sourceraw docstring

mark-terminated!clj

(mark-terminated! daemon-id)

Mark daemon as terminated. Delegates to IEmacsDaemon.mark-terminated!

Mark daemon as terminated. Delegates to IEmacsDaemon.mark-terminated!
sourceraw docstring

orphan-statusclj

(orphan-status)

Get current orphan status without healing. Monitoring endpoint.

Returns: Map with :orphan-count, :orphans (with classified actions) or nil if no orphans.

Get current orphan status without healing. Monitoring endpoint.

Returns:
  Map with :orphan-count, :orphans (with classified actions)
  or nil if no orphans.
sourceraw docstring

redistribute-lings!clj

(redistribute-lings!)

Manually trigger ling redistribution from overloaded/degraded daemons. Useful for immediate rebalancing outside the heartbeat cycle.

Returns: Map with :migrations-planned, :migrations-executed, :migrations-failed, :results or nil if no redistribution needed.

Manually trigger ling redistribution from overloaded/degraded daemons.
Useful for immediate rebalancing outside the heartbeat cycle.

Returns:
  Map with :migrations-planned, :migrations-executed, :migrations-failed, :results
  or nil if no redistribution needed.
sourceraw docstring

redistribution-statusclj

(redistribution-status)

Get current redistribution status without executing. Monitoring endpoint.

Returns: Map with :overloaded-count, :overloaded-daemons, :planned-migrations or nil if system is balanced.

Get current redistribution status without executing. Monitoring endpoint.

Returns:
  Map with :overloaded-count, :overloaded-daemons, :planned-migrations
  or nil if system is balanced.
sourceraw docstring

register!clj

(register! daemon-id opts)

Register a new Emacs daemon. Delegates to IEmacsDaemon.register!

Register a new Emacs daemon. Delegates to IEmacsDaemon.register!
sourceraw docstring

reset-store!clj

(reset-store!)
(reset-store! store)

Replace the singleton repository. Intended for lifecycle reset and tests.

Replace the singleton repository. Intended for lifecycle reset and tests.
sourceraw docstring

select-daemon-for-lingclj

(select-daemon-for-ling)
(select-daemon-for-ling opts)

Select the best daemon for a new ling spawn.

Uses health scoring, capacity limits, and project affinity to pick the optimal daemon. Falls back to default daemon if no better option.

Arguments: opts - Optional map with: :project-id - Target project for affinity scoring

Returns: Map with :daemon-id and :reason (:selected, :no-daemons, :all-disqualified)

Select the best daemon for a new ling spawn.

Uses health scoring, capacity limits, and project affinity to pick
the optimal daemon. Falls back to default daemon if no better option.

Arguments:
  opts - Optional map with:
         :project-id - Target project for affinity scoring

Returns:
  Map with :daemon-id and :reason (:selected, :no-daemons, :all-disqualified)
sourceraw docstring

start-heartbeat-loop!clj

(start-heartbeat-loop!)

Start the background heartbeat loop. Idempotent - does nothing if already running.

Returns: Current heartbeat state

Start the background heartbeat loop.
Idempotent - does nothing if already running.

Returns:
  Current heartbeat state
sourceraw docstring

stop-heartbeat-loop!clj

(stop-heartbeat-loop!)

Stop the background heartbeat loop. Idempotent - does nothing if not running.

Returns: Current heartbeat state

Stop the background heartbeat loop.
Idempotent - does nothing if not running.

Returns:
  Current heartbeat state
sourceraw docstring

unbind-ling!clj

(unbind-ling! daemon-id ling-id)

Unbind a ling from a daemon. Delegates to IEmacsDaemon.unbind-ling!

Unbind a ling from a daemon. Delegates to IEmacsDaemon.unbind-ling!
sourceraw docstring

update-daemon-health!clj

(update-daemon-health! daemon-id score)

Update a daemon's health score. Delegates to daemon-selection.

Arguments: daemon-id - Daemon to update score - New health score (0-100)

Update a daemon's health score. Delegates to daemon-selection.

Arguments:
  daemon-id - Daemon to update
  score     - New health score (0-100)
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close