transactional-enqueue

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

Transactional enqueue

Writes an order and its invoice job in one transaction. The committed order's job runs; the rolled-back order leaves no job behind.

Run

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

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

invoicing order 1
committed order: job 1 completed
rolled back order: no job

Documentation

Overview

Command transactional-enqueue shows that a job inserted with InsertTx exists only if its transaction commits.

Jump to

Keyboard shortcuts

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