Skip to main content

Jobs and shutdown


Operations · Jobs and shutdown

Operational objective — Make background work finish, retry, pause, or fail with a known outcome when the process changes state.
Idempotent jobs, signal handling, draining, retry policy, and bounded shutdown.

Key concepts

Retry

Transient only

Drain

Finite window

Abandon

Recorded

Operational surface

Evidence over assumption

Operational context

A process exit is normal infrastructure behavior; work should not depend on a lucky timing window.
Operator’s principle Graceful shutdown is a correctness feature for any system that performs side effects.

Implementation notes

Decision lens

Reference queue

InMemoryJobQueue is a reference implementation for local development and adapter conformance. It supports bounded concurrency, idempotency keys, retry attempts, configurable retry delay, and an inspectable dead-letter snapshot. It is intentionally process-local; use a durable provider for production or multiple instances.

References

Last modified on September 10, 2026