View Source ProcessHub.Service.DeclaredChildren.Store (ProcessHub v0.7.0)
Local persistence of the declared list: the DETS-backed store beside the
registry file, the misc-storage read cache, the seeded marker, the park flag,
and the hand-off to the remote-manifest shipper. Every stored manifest goes
through write/2, so the persist-before-cache order and the seeded marker
are maintained in one place.
Summary
Functions
Refreshes the misc-storage read cache for an already-persisted manifest.
Lifts the park flag.
Opens the list's durable store; returns the :declared_backend and
:declared_path entries for the hub's storage map. Called by the initializer
when the feature gate is on.
Reads the persisted manifest: {:ok, manifest | nil} (missing and malformed
both read as absent), or an error for a format newer than this release.
Returns whether the hub has ever stored a list (marker survives rotation).
Sets the park flag the reconcile and mutations check.
Hands the manifest to the remote shipper; a no-op without a remote.
Persists manifest, refreshes the read cache, and sets the seeded marker.
Functions
@spec cache(ProcessHub.Hub.t(), ProcessHub.Service.DeclaredChildren.manifest()) :: :ok | boolean()
Refreshes the misc-storage read cache for an already-persisted manifest.
@spec clear_parked(ProcessHub.Hub.t()) :: :ok | boolean()
Lifts the park flag.
@spec open(ProcessHub.hub_id(), term()) :: %{ declared_backend: {module(), term()}, declared_path: String.t() }
Opens the list's durable store; returns the :declared_backend and
:declared_path entries for the hub's storage map. Called by the initializer
when the feature gate is on.
@spec read(ProcessHub.Hub.t()) :: {:ok, ProcessHub.Service.DeclaredChildren.manifest() | nil} | {:error, term()}
Reads the persisted manifest: {:ok, manifest | nil} (missing and malformed
both read as absent), or an error for a format newer than this release.
@spec seeded?(ProcessHub.Hub.t()) :: boolean()
Returns whether the hub has ever stored a list (marker survives rotation).
@spec set_parked(ProcessHub.Hub.t()) :: :ok | boolean()
Sets the park flag the reconcile and mutations check.
@spec ship(ProcessHub.Hub.t(), ProcessHub.Service.DeclaredChildren.manifest()) :: :ok
Hands the manifest to the remote shipper; a no-op without a remote.
@spec write(ProcessHub.Hub.t(), ProcessHub.Service.DeclaredChildren.manifest()) :: :ok | {:error, term()}
Persists manifest, refreshes the read cache, and sets the seeded marker.