Expand description
Durable typed work for Minco: typed job contracts, an explicit handler registry, a bounded versioned envelope, at-least-once dispatch ports, lease-based execution, retry and permanent-failure semantics, overlap locks and explicit scheduling contracts.
Jobs are commands with one registered handler, never domain events. The durable job row owns execution state, the publication row owns pending transport delivery, and the queue message is delivery, never truth. Nothing in this crate schedules itself: dispatch is explicit and bounded, and disabling the jobs capability creates no queue, worker or schedule.
Delivery is at least once. Duplicate deliveries are neutralized by an
atomic execution claim; application effects must still be idempotent.
Payload and metadata values never appear in Debug output.
Modules§
- failure_
codes - Stable public failure codes used by the executor itself.
Structs§
- Dispatch
Attempt - One recorded dispatch attempt. Never carries the payload into
Debug. - Dispatch
Report - Bounded report for one explicit dispatch run.
- Fail
Closed Dispatcher - A dispatcher that fails every dispatch closed.
- Fake
JobClock - A deterministic clock for tests, advancing only when told to.
- Fake
JobDispatcher - Recording fake dispatcher with deterministic one-shot failures.
- JobAttempt
- One bounded attempt-history entry. The newest entry is last.
- JobClaim
- A claimed execution: the authoritative record plus its opaque lease identity.
- JobContext
- Bounded execution context handed to a handler. Its
Debugoutput shows only structural information — metadata names and bounded key lengths — never partition or metadata values. - JobDelivery
- One outbound transport delivery: the envelope plus the durable identity of the publication being sent.
- JobEnvelope
- A durable typed work command envelope.
- JobExecution
Failure - A handler failure with stable, public-safe classification.
- JobExecutor
- Executes one job delivery to a durable disposition.
- JobHandler
Registry - The explicit, statically populated job handler registry.
- JobOptions
- Optional submission-time configuration applied through
JobEnvelope::with.Debugshows only structural information: key presence, bounded lengths and metadata names, never values. - JobPublication
- One durable transport publication generation of one job.
- JobRecord
- The authoritative durable job record.
- Jobs
Plugin - Official jobs plugin: registers
JobsServicesbehind explicit composition. The plugin never creates a schedule, daemon or poller. - Jobs
Services - The composed job services registered by the plugin.
- Memory
JobStore - In-memory job store implementing every job port with reference semantics. All operations run under one lock, mirroring the SQL adapters’ single-transaction atomicity.
- Profile
Routed Dispatcher - Routes dispatch by worker profile: one explicit, validated route per profile. An unknown profile fails before any provider contact, and one profile can never dispatch through another profile’s route.
- Resolved
Handler - A handler resolved for execution, plus any upcaster chain that must be applied to the payload first.
- Retry
Policy - A bounded, serializable retry policy.
- System
JobClock - The real system clock.
- Typed
JobHandler - Adapter wrapping a typed async closure for a specific
Job.
Enums§
- Backoff
Mode - How the delay before the next attempt grows.
- Durable
Submission - Result of a durable submission.
- Enqueue
Outcome - Outcome of a duplicate-key submission.
- Ingest
Outcome - Outcome of ingesting a delivery that already exists on the transport (Scheduler occurrences): the job is created or located with its publication marked delivered, never pending.
- JobAttempt
Outcome - JobError
- Errors carry stable, public-safe codes; infrastructure details stay in the redacted message.
- JobExecution
Disposition - JobRun
Disposition - How one delivery was disposed of.
- JobSkip
Reason - JobStatus
- Durable job execution state.
- Publication
Status - Publication state for the transport outbox.
Constants§
- DEFAULT_
EXECUTION_ LEASE - Default execution lease granted to one worker delivery.
- DEFAULT_
EXECUTION_ TIMEOUT - Default per-execution handler timeout when none is configured.
- JOB_
ENVELOPE_ SCHEMA_ VERSION - Current envelope wire schema. Envelopes carrying any other schema version are rejected before decode.
- MAX_
ATTEMPT_ HISTORY - Maximum attempt-history entries retained on a record.
- MAX_
BACKOFF_ DELAY - Hard ceiling for a single backoff delay.
- MAX_
JOB_ ATTEMPTS - Hard ceiling on attempts configured by a retry policy.
- MAX_
JOB_ ENVELOPE_ BYTES - Maximum complete serialized envelope bytes, kept below provider ceilings.
- MAX_
JOB_ KEY_ BYTES - Maximum dedupe/overlap key length in bytes.
- MAX_
JOB_ METADATA_ ENTRIES - Maximum metadata entries per envelope.
- MAX_
JOB_ METADATA_ NAME_ BYTES - Maximum metadata name length in bytes.
- MAX_
JOB_ METADATA_ VALUE_ BYTES - Maximum metadata value length in bytes.
- MAX_
JOB_ NAME_ BYTES - Maximum logical job name length in bytes.
- MAX_
JOB_ PARTITION_ BYTES - Maximum partition reference length in bytes.
- MAX_
JOB_ PAYLOAD_ BYTES - Maximum serialized payload bytes. Large content belongs in object storage.
- MAX_
WORKER_ PROFILE_ BYTES - Maximum worker-profile identifier length in bytes.
- OVERLAP_
RETRY_ DELAY - Delay before re-running a job whose overlap lock is busy.
- PUBLICATION_
RETRY_ DELAY - Publication retry backoff after a failed transport send.
Traits§
- Job
- A typed durable job command with a stable logical name and payload version. The name and version are wire identity; the Rust type never crosses a transport.
- JobClock
- Readable clock port so retry arithmetic and leases are testable.
- JobDispatcher
- Publishes one delivery to the selected transport. The queue message is delivery, never state.
- JobHandler
- An erased handler for one
(job name, version)pair. - JobPublication
Store - Transport publication outbox. Claims are atomic and fenced by an opaque publication lease identity.
- JobStore
- Durable job state store.
- Overlap
Lock Store - Narrow overlap-lock port backing
without_overlappingsemantics.
Functions§
- pending_
record - Build a pending
JobRecordaround an envelope for store submission. - semantic_
fingerprint - Canonical semantic fingerprint of a job envelope.
- typed
- Create a handler for
JobJfrom an async closure receiving the decoded typed payload and the bounded context. - validate_
job_ name - Validate a stable logical job name.
- validate_
worker_ claim - Validate explicit dispatch/claim parameters shared by every adapter.
- validate_
worker_ profile - Validate a stable worker-profile identifier.
Type Aliases§
- Payload
Upcaster - A payload upcaster converts a previous payload version into the current representation during the supported compatibility window.