The authorities (Issho.Authority) of an Issho instance: one for each
open document, found by name on every node of a cluster.
The registry is :global unless the instance's :registry is a module
with name(instance, document_id), which returns a GenServer name
(a {:via, ...} tuple for Horde or a partitioned registry).
Summary
Functions
Returns a specification to start this module under a supervisor.
The authority of a document, started if it is not running anywhere.
The authority of a document if it is running, on any node, or nil.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec open(atom(), String.t(), Issho.Identity.t() | nil, keyword()) :: {:ok, pid()} | {:error, term()}
The authority of a document, started if it is not running anywhere.
What the document is (its spec) comes from the first open: the policy's
Issho.Policy.document/2, asked with the identity of whoever opens
it, or a :spec given by your server's own code, such as a component
that holds the document's initial content and its hook. A browser never
gives a spec.
A spec is a map:
:engine(required): the document'sIssho.Engineor binding.:initial: the initial content, when the store has nothing.:opts: the engine's options.:store:{module, context}, or:nonefor a document that lasts as long as its authority (Issho.Store.None); the instance's store unless given.:on_transaction: a function of the operations and a context (:document,:author,:revision, and the state:beforeand:after), run once for each accepted transaction, after the engine and before it is saved and confirmed. It answers:ok(or{:ok, anything}), or{:error, reason}to refuse the transaction: the place to save each change in your own tables.
The authority of a document if it is running, on any node, or nil.