Macaw.Data.Manager.Reader (macaw_data v0.21.1)
View SourceA reader of a source manager's table (spec/01 §6.4.6): a reader's window read from what the manager published, in the reader's own process, never calling the manager, so a manager busy with a write never holds a read.
read/3 looks the manager up in the supervisor's Registry, takes the published object
of its index, held slots and status, and, when the reader's window lies in the held
slots, reads it with Macaw.Data.Source.Manager.read/3 over a lookup of the table. A
version the index names and the table no longer holds (the manager superseded it
meanwhile) is read again from the index published since, up to three times. It answers
{status, delivery}, the delivery finished for the request (window, box, region,
latest, order, budget and reducer) once for every reader asking it
(Macaw.Data.Manager.Finished), or {status, nil} for a window not held, status
then :loading unless the source is down.
Summary
Functions
The published index of the manager of key and its status: {:ok, index, status}, or
:error before anything is published or with no manager running.
The window request asks of the manager of key: {status, delivery}, {status, nil}
for a window it doesn't hold (no manager running, nothing published, or slots not read
yet), or {{:down, {:finish, faults}}, nil} for a request finishing refuses.
The status the manager of key published: :loading with none running.
Functions
@spec index(atom(), Macaw.Data.Manager.key()) :: {:ok, Macaw.Data.Source.Manager.Index.t(), Macaw.Data.Manager.status()} | :error
The published index of the manager of key and its status: {:ok, index, status}, or
:error before anything is published or with no manager running.
@spec read(atom(), Macaw.Data.Manager.key(), Macaw.Data.Source.Request.t()) :: {Macaw.Data.Manager.status(), Macaw.Data.Delivery.t() | nil}
The window request asks of the manager of key: {status, delivery}, {status, nil}
for a window it doesn't hold (no manager running, nothing published, or slots not read
yet), or {{:down, {:finish, faults}}, nil} for a request finishing refuses.
@spec status(atom(), Macaw.Data.Manager.key()) :: Macaw.Data.Manager.status()
The status the manager of key published: :loading with none running.