Skip to main content

Module eventos

Module eventos 

Source
Expand description

The Postgres side of domain events (ADR-0018 § 4): the outbox the relay reads, the db transport (entregas_eventos) and the dead-letter sink every transport writes to. The tables are migrations/outbox.sql, which puerto new --eventos writes into the project.

Structs§

DescartadosPostgres
descartados, whatever the transport. Recording the same event for the same consumer twice keeps the first record (descartados_evento_consumidor).
EntregasPostgres
The relay’s publisher on the db transport: fans each event out to the consumers subscribed to its type and marks it published, in one transaction.
OutboxPostgres
The outbox, as the relay reads it.
SuscripcionPostgres
One consumer’s input on the db transport.

Constants§

CLAVE_BLOQUEO_RELAY
The advisory lock the relay holds: only one worker replica relays, so the outbox order is kept. The bytes of "puerto".
RESERVA_POR_DEFECTO
How long a claimed delivery stays invisible to other claims. A worker that dies while handling one leaves it due again after this — at-least-once, never lost.