Strata is pre-1.0. APIs, protocol, and storage format may change.
strata_server/doc_presence
Tracks live socket counts per document for read-only admin status.
Tracker
Section titled “Tracker”Opaque handle to the document presence tracker actor.
pub type TrackerFunctions
Section titled “Functions”child_spec
Section titled “child_spec”Build a supervised tracker with a stable handle and empty restart state.
pub fn child_spec() -> #(Tracker, supervision.ChildSpecification(Nil))counts
Section titled “counts”Return live socket counts by document id.
Returns Error(ActorCallTimedOut) if the tracker actor does not
reply before the configured timeout.
pub fn counts(Tracker) -> Result(List(#(String, Int)), store.ActorCallError)Record a socket joining a document.
pub fn join( Tracker, String, String) -> NilRecord a socket leaving a document.
pub fn leave( Tracker, String, String) -> NilStart an empty document presence tracker.
pub fn start() -> Result(Tracker, actor.StartError)