Help us shape the future of Go! Take the 2026 Go Developer Survey

events

package
v1.21.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2026 License: GPL-3.0 Imports: 6 Imported by: 0

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

func (h *DeliverDomainEventHandler) ProcessTask(ctx context.Context, task *asynq.Task) error

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.

func (*DispatchDomainEventsHandler) ProcessTask added in v1.21.0

func (h *DispatchDomainEventsHandler) ProcessTask(ctx context.Context, _ *asynq.Task) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL