river

package
v0.0.0-...-2d0bd23 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JobQueue

type JobQueue struct {
	// contains filtered or unexported fields
}

JobQueue wraps the River client for email job processing

func NewJobQueue

func NewJobQueue(db *postgres.DB, config WorkerConfig) (*JobQueue, error)

NewJobQueue creates a new River-based job queue client

func (*JobQueue) EnqueueEmailJob

func (c *JobQueue) EnqueueEmailJob(ctx context.Context, jobArgs *email.JobArgs) error

EnqueueEmailJob enqueues an email job to the queue

func (*JobQueue) Start

func (c *JobQueue) Start(ctx context.Context) error

Start starts the River job queue workers

func (*JobQueue) Stop

func (c *JobQueue) Stop(ctx context.Context) error

Stop stops the River client gracefully

type SendEmailWorker

type SendEmailWorker struct {
	river.WorkerDefaults[email.JobArgs]
	// contains filtered or unexported fields
}

SendEmailWorker processes email sending jobs from the River queue

func NewSendEmailWorker

func NewSendEmailWorker(config WorkerConfig) *SendEmailWorker

NewSendEmailWorker creates a new email worker

func (*SendEmailWorker) Work

func (w *SendEmailWorker) Work(ctx context.Context, job *river.Job[email.JobArgs]) error

Work processes a single email job by passing an Email struct to the client

type WorkerConfig

type WorkerConfig struct {
	EmailService emailService
	FromAddress  string
	FromName     string
}

WorkerConfig holds configuration for email workers

Jump to

Keyboard shortcuts

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