Repository navigation
rust/v0.4.0
馃 River for Rust 0.4.0.
Added
- Extend the unstable extension API with peer work hooks, resolved insertion options, and bounded producer claims. Post-insert callbacks now include existing unique duplicates, requested metadata, and duplicate flags. PR #1501.
- Add optional pilot hooks for single-job, bulk, and cleaner-driven deletion. Hooks run within the deletion transaction and can extend or replace the standard deletion. PR #1502.
- A worker cancels its job with a reason by returning
JobCancelError, like River for Go'sJobCancel(err). Anywhere in the worker error's source chain, it cancels the job whatever attempts it has left, skips the error handler, and recordsJobCancelError: <reason>on the attempt as Go does.WorkOutcome::Cancelstill cancels without a reason. PR #1504.
Changed
- Breaking: Resumable steps can no longer be nested. Calls fail before running child callbacks, preventing unreachable resume points and rolled-back parent checkpoints from being saved again. PR #1534.
- Breaking: Attempt counts are now
i32instead ofi16, like River for Go'sint:JobRow::attemptandmax_attempts,AttemptError::attemptandAttemptError::new,InsertOpts::max_attemptsandwith_max_attempts,InsertParams::max_attempts,ClientBuilder::default_max_attempts,MAX_ATTEMPTS_DEFAULT, andriverqueue-test's builders. On SQLite, which stores native integers, a job with more than 32,767 maximum attempts inserts and reads back unchanged, as in Go. On Postgres, whose columns are 16-bit, an insert clampsmax_attemptsto 32,767 like Go's drivers instead of failing. PR #1504.
Fixed
- Preserve original error types through work-begin hooks and peer outcomes so error handlers can downcast them. A
JobCancelErrorreported for a peer cancels it, matching worker cancellation. PR #1501. - Fail retries that omit a saved cursor-only step, while preserving their checkpoints for recovery. Jobs with an existing step marker retain their behavior, including legacy stale cursor entries. PR #1534.
- Replace whole top-level metadata values on SQLite, including JSON null, matching Postgres. Completed resumable cursor steps no longer run again because of stale cursor entries. PR #1533.
- Preserve first-step resumable cursors on failure and step progress on snooze. Transactional checkpoints no longer leak into deferred updates after rollback or a failed write; rolling back a successful checkpoint write may replay earlier unpersisted steps. PR #1521.