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.
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 ¶
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.