Skip to main content

Crate minco_plugin_jobs

Crate minco_plugin_jobs 

Source
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§

DispatchAttempt
One recorded dispatch attempt. Never carries the payload into Debug.
DispatchReport
Bounded report for one explicit dispatch run.
FailClosedDispatcher
A dispatcher that fails every dispatch closed.
FakeJobClock
A deterministic clock for tests, advancing only when told to.
FakeJobDispatcher
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 Debug output 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.
JobExecutionFailure
A handler failure with stable, public-safe classification.
JobExecutor
Executes one job delivery to a durable disposition.
JobHandlerRegistry
The explicit, statically populated job handler registry.
JobOptions
Optional submission-time configuration applied through JobEnvelope::with. Debug shows 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.
JobsPlugin
Official jobs plugin: registers JobsServices behind explicit composition. The plugin never creates a schedule, daemon or poller.
JobsServices
The composed job services registered by the plugin.
MemoryJobStore
In-memory job store implementing every job port with reference semantics. All operations run under one lock, mirroring the SQL adapters’ single-transaction atomicity.
ProfileRoutedDispatcher
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.
ResolvedHandler
A handler resolved for execution, plus any upcaster chain that must be applied to the payload first.
RetryPolicy
A bounded, serializable retry policy.
SystemJobClock
The real system clock.
TypedJobHandler
Adapter wrapping a typed async closure for a specific Job.

Enums§

BackoffMode
How the delay before the next attempt grows.
DurableSubmission
Result of a durable submission.
EnqueueOutcome
Outcome of a duplicate-key submission.
IngestOutcome
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.
JobAttemptOutcome
JobError
Errors carry stable, public-safe codes; infrastructure details stay in the redacted message.
JobExecutionDisposition
JobRunDisposition
How one delivery was disposed of.
JobSkipReason
JobStatus
Durable job execution state.
PublicationStatus
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.
JobPublicationStore
Transport publication outbox. Claims are atomic and fenced by an opaque publication lease identity.
JobStore
Durable job state store.
OverlapLockStore
Narrow overlap-lock port backing without_overlapping semantics.

Functions§

pending_record
Build a pending JobRecord around an envelope for store submission.
semantic_fingerprint
Canonical semantic fingerprint of a job envelope.
typed
Create a handler for Job J from 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§

PayloadUpcaster
A payload upcaster converts a previous payload version into the current representation during the supported compatibility window.