View Source ProcessHub.Service.Storage.DetsFile (ProcessHub v0.6.0)

On-disk DETS file management shared by the DETS-file storage backends (ProcessHub.Service.Storage.Dets and ProcessHub.Service.Storage.DurableEts).

Covers path resolution and corruption rotation. It is specific to persisting through a DETS file; in-memory or remote backends do not use it.

Summary

Functions

Resolves the on-disk path for hub_id (:path option, else priv/process_hub/<hub_id>/registry.dets).

Rotates a corrupt DETS file aside, logs at ERROR, and reopens a fresh file.

Functions

Link to this function

resolve_path(hub_id, opts)

View Source
@spec resolve_path(
  atom(),
  keyword()
) :: String.t()

Resolves the on-disk path for hub_id (:path option, else priv/process_hub/<hub_id>/registry.dets).

Link to this function

rotate_and_reopen(hub_id, path, reason)

View Source
@spec rotate_and_reopen(atom(), String.t(), term()) ::
  {{:ok, atom()} | {:error, term()}, boolean()}

Rotates a corrupt DETS file aside, logs at ERROR, and reopens a fresh file.