eventqueue

package
v1.8.3 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: AGPL-3.0 Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package eventqueue polls the event queues of connections whose events come through a queue ReputeCast reads instead of a webhook (review PR-4: SES → SNS → an SQS queue). Nothing has to reach ReputeCast from the internet, so it works behind NAT and firewalls.

Each message is stored as a raw event, like a webhook delivery, and normalized later by the ingest job; it leaves the queue only once it is stored, so a crash or a restart loses nothing (the queue redelivers it).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PollArgs

type PollArgs struct{}

PollArgs polls every event queue once (about a minute of long polls).

func (PollArgs) InsertOpts

func (PollArgs) InsertOpts() river.InsertOpts

InsertOpts implements river.JobArgsWithInsertOpts.

func (PollArgs) Kind

func (PollArgs) Kind() string

Kind implements river.JobArgs.

type Worker

type Worker struct {
	river.WorkerDefaults[PollArgs]
	Pool    *pgxpool.Pool
	Q       *store.Queries
	Factory *manage.Factory
	Jobs    func() *jobs.Client
	Log     *slog.Logger
	Now     func() time.Time
	// OnPoll is told how each poll of a queue went, so a queue that can't
	// be read reaches the provider's health.
	OnPoll func(ctx context.Context, p store.Provider, err error)
	// For overrides how long a job polls each queue (tests).
	For time.Duration
}

Worker polls the queues.

func (*Worker) Poll

func (w *Worker) Poll(ctx context.Context, p store.Provider) (n int, err error)

Poll reads a provider's queue for up to a minute: each message is stored as a raw event and queued for normalization, then removed from the queue.

func (*Worker) Timeout

func (w *Worker) Timeout(*river.Job[PollArgs]) time.Duration

Timeout bounds one job.

func (*Worker) Work

func (w *Worker) Work(ctx context.Context, _ *river.Job[PollArgs]) error

Work implements river.Worker.

Jump to

Keyboard shortcuts

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