Documentation
¶
Overview ¶
Package events hosts the queue shells of the domain-event bus: the publish pump moving outbox rows onto the asynq broker, and the delivery worker running subscribers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeliverDomainEventHandler ¶ added in v1.21.0
type DeliverDomainEventHandler struct {
// contains filtered or unexported fields
}
DeliverDomainEventHandler is the delivery worker: each task carries one outbox event, and the bus runs every subscriber of its topic. A failing subscriber fails the task so asynq retries with backoff and eventually archives it (the dead-letter queue); subscribers are idempotent, so retries and duplicate deliveries are safe.
func NewDeliverDomainEventHandler ¶ added in v1.21.0
func NewDeliverDomainEventHandler(bus *eventbus.Bus) *DeliverDomainEventHandler
NewDeliverDomainEventHandler builds the delivery worker over the bus.
func (*DeliverDomainEventHandler) ProcessTask ¶ added in v1.21.0
type DispatchDomainEventsHandler ¶ added in v1.21.0
type DispatchDomainEventsHandler struct {
// contains filtered or unexported fields
}
DispatchDomainEventsHandler is the publish pump: it drains the generic domain-event outbox onto the asynq queue. Enqueues deduplicate by outbox event id, so the tick can retry freely.
func NewDispatchDomainEventsHandler ¶ added in v1.21.0
func NewDispatchDomainEventsHandler(bus *eventbus.Bus) *DispatchDomainEventsHandler
NewDispatchDomainEventsHandler builds the publish pump over the bus.