v0.13.0
Added
-
A middleware system was added for job insertion and execution, providing the ability to extract shared functionality across workers. Both
JobInsertMiddleware
andWorkerMiddleware
can be configured globally on theClient
, andWorkerMiddleware
can also be added on a per-worker basis using the newMiddleware
method onWorker[T]
. Middleware can be useful for logging, telemetry, or for building higher level abstractions on top of base River functionality.Despite the interface expansion, users should not encounter any breakage if they're embedding the
WorkerDefaults
type in their workers as recommended. PR #632.
Changed
- Breaking change: The advisory lock unique jobs implementation which was deprecated in v0.12.0 has been removed. Users of that feature should first upgrade to v0.12.1 to ensure they don't see any warning logs about using the deprecated advisory lock uniqueness. The new, faster unique implementation will be used automatically as long as the
UniqueOpts.ByState
list hasn't been customized to remove required states (pending
,scheduled
,available
, andrunning
). As of this release, customizingByState
without these required states returns an error. PR #614. - Single job inserts are now unified under the hood to use the
InsertMany
bulk insert query. This should not be noticeable to users, and the unified code path will make it easier to build new features going forward. PR #614.
Fixed
- Allow
river.JobCancel
to accept anil
error as input without panicking. PR #634.