Minga.Project.WorkspaceSnapshot (Minga v0.1.0)

Copy Markdown View Source

Atomic cached state for one active directory workspace.

The root authorizes recursive project behavior, files are always relative to that root, and rebuilding? describes discovery for that same root. Operational worker, monitor, and timer state remains owned by Minga.Project.

Summary

Types

A monotonic identity assigned to one explicit workspace activation.

t()

A coherent directory workspace and its cached inventory state.

Functions

Installs a directory root with a fresh activation identity and an empty inventory.

Marks discovery as running for this workspace.

Installs one completed workspace-relative inventory atomically.

Clears cached inventory before discovery starts.

Marks discovery as stopped while retaining the current cached inventory.

Types

activation_id()

@type activation_id() :: pos_integer()

A monotonic identity assigned to one explicit workspace activation.

t()

@type t() :: %Minga.Project.WorkspaceSnapshot{
  activation_id: activation_id(),
  files: [String.t()],
  rebuilding?: boolean(),
  root: Minga.Project.Root.t()
}

A coherent directory workspace and its cached inventory state.

Functions

activate(root)

@spec activate(Minga.Project.Root.t()) :: t()

Installs a directory root with a fresh activation identity and an empty inventory.

begin_rebuild(snapshot)

@spec begin_rebuild(t()) :: t()

Marks discovery as running for this workspace.

complete_rebuild(snapshot, files)

@spec complete_rebuild(t(), [String.t()]) :: t()

Installs one completed workspace-relative inventory atomically.

invalidate(snapshot)

@spec invalidate(t()) :: t()

Clears cached inventory before discovery starts.

stop_rebuild(snapshot)

@spec stop_rebuild(t()) :: t()

Marks discovery as stopped while retaining the current cached inventory.