View Source API Reference EchoPubSub v0.2.4
Modules
Phoenix PubSub adapter using :pg with at-least-once delivery.
Single source of truth for the compile-time fault-injection switch, shared by the producer (outgoing) and worker (incoming) to simulate a network partition.
Resolves the adapter options: each comes from the supervisor opts, else the
config :echo_pubsub, <pubsub name> entry, else its default, and is validated
so a bad value fails at startup instead of far from its cause.
Sends this node's broadcasts to the workers on other nodes, one producer per pool group.
Sends a registered node what it still needs, in a task. The node's cursor moves to the batch's target only when its worker acks, so a failed batch is resent.
Registers a remote worker before its first batch: {:register, node, missed_writes?}
when the producer has no cursor for it, {:resume, node} when only its worker
restarted.
Runs in a task; finish/5 folds the reply into the producer state.
Calls the producer's tasks make to remote workers. Every failure (timeout,
dead worker, nodedown, injected fault, non-:ok reply) becomes an error
result, so a task never crashes.
Pure helpers over the producer's fixed-size :array. Cursors only grow; a
cursor maps to slot rem(cursor, capacity), so a write overwrites the message
capacity positions behind it.
The producer's state and the only place that changes it. Other modules read fields directly but update them through the named functions here.
The producer's telemetry events and its throttled buffer-capacity warning.
Schedules the producer's :flush_all: batch flushes, retries and follow-ups. One timer at a time.
Receives batches from the producers on other nodes and broadcasts them to this node's subscribers, one worker per pool group.