Mob.Defect.Bus.Owner (mob v0.8.2)

Copy Markdown View Source

Owns Mob.Defect.Bus's ETS tables and the subscriber registry.

Same reason Mob.Invariant.Owner and Mob.Agent.Receipts.Owner exist: an ETS table dies with its creator, so a table that outlives the process which emitted the first defect has to be owned by something the framework controls. Unlinked, so a diagnostic neither dies with an emitter nor takes one down.

Subscribers are stored here (in this process's state) and cached in :persistent_term for the write path to read without a mailbox round-trip. Every subscribed pid is monitored so an exit prunes it out of the cache automatically.

Summary

Functions

Returns a specification to start this module under a supervisor.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.