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