basic

command
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

README

Basic usage

Registers an EmailWorker, enqueues a welcome email in the same transaction as the user row (InsertTx), and waits for the job to complete. This is the example from the README.

Run

docker compose -f deploy/docker-compose.yml up -d --wait postgres
go run ./examples/basic

The example connects to FOREMAN_DATABASE_URL (default postgres://foreman:foreman@localhost:55432/foreman?sslmode=disable) and recreates its own schema on every run.

Expected output

sending "welcome" email to user 1 (attempt 1)
job completed: id=1 state=completed

Documentation

Overview

Command basic registers a worker, enqueues a job in a transaction together with a business row, and waits for the job to complete.

Jump to

Keyboard shortcuts

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