Arc.Notifier (cratis_arc v0.1.0)

Copy Markdown View Source

Tells observable queries to run again.

Queries declared with @observe watch: [Model] re-run when Chronicle reports a change to that read model. For anything else, declare @observe topics: ["authors"] and call notify/2 when the data changes:

Arc.Notifier.notify(MyApp.Arc, "authors")

Subscriptions are processes registered in the application's Registry, so notification works across processes on a node. Cluster-wide fan-out is the application's choice: broadcast with Phoenix.PubSub (or :pg) and call notify/2 in the receiving handler on each node.

Summary

Functions

Notifies every observable query subscribed to topic on this node.

Functions

notify(app, topic)

@spec notify(module(), term()) :: :ok

Notifies every observable query subscribed to topic on this node.