SuperPi.Durable.DocCache (super_pi v0.1.0)

Copy Markdown View Source

Keeps the document cache (SuperPi.Durable.Doc) coherent across nodes.

After a commit, the writer broadcasts the keys it wrote (broadcast/1). Every other node drops those entries and reads the new value from the database on its next read. On a single node nothing is sent.

This is best effort and is backed by the cache TTL: a node can still read an old value for a moment after another node commits.

Summary

Functions

Tells the other nodes that these cache keys changed. Does nothing without other nodes.

Returns a specification to start this module under a supervisor.

Functions

broadcast(keys)

Tells the other nodes that these cache keys changed. Does nothing without other nodes.

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(opts \\ [])