All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Minor README fixes. PR #50.
- Periodic gem update (including some security upgrades in dependencies). PR #51.
by_perioduniqueness is now based off a job'sscheduled_atinstead of the current time if it has a value. PR #39.
- Correct some mistakes in the readme that referenced
SimpleArgsinstead ofSortArgs. PR #44.
Users should upgrade backends to River v0.12.0 before upgrading this library in order to ensure a seamless transition of all in-flight jobs. Afterward, the latest River version may be used.
- Breaking change: The return type of
Client#insert_manyhas been changed. Rather than returning just the number of rows inserted, it returns an array of all theInsertResultvalues for each inserted row. Unique conflicts which are skipped as duplicates are indicated in the same fashion as single inserts (theunique_skipped_as_duplicatedattribute), and in such cases the conflicting row will be returned instead. PR #32. - Breaking change: Unique jobs no longer allow total customization of their states when using the
by_stateoption. The pending, scheduled, available, and running states are required whenever customizing this list. PR #32.
-
The
UniqueOptsclass gains anexclude_kindoption for cases where uniqueness needs to be guaranteed across multiple job types. PR #32. -
Unique jobs utilizing
by_argscan now also opt to have a subset of the job's arguments considered for uniqueness. For example, you could choose to consider only thecustomer_idfield while ignoring the other fields:UniqueOpts.new(by_args: ["customer_id"])
Any fields considered in uniqueness are also sorted alphabetically in order to guarantee a consistent result across implementations, even if the encoded JSON isn't sorted consistently. PR #32.
-
Unique jobs have been improved to allow bulk insertion of unique jobs via
Client#insert_many.This updated implementation is significantly faster due to the removal of advisory locks in favor of an index-backed uniqueness system, while allowing some flexibility in which job states are considered. However, not all states may be removed from consideration when using the
by_stateoption; pending, scheduled, available, and running states are required whenever customizing this list. PR #32. -
Update REXML dependency. PR #28.
- Now compatible with "fast path" unique job insertion that uses a unique index instead of advisory lock and fetch as introduced in River #451. PR #28.
- Fix source files not being correctly included in built Ruby gems. PR #26.
- Advisory lock prefixes are now checked to make sure they fit inside of four bytes. PR #24.
- Tag format is now checked on insert. Tags should be no more than 255 characters and match the regex
/\A[\w][\w\-]+[\w]\z/. PR #22. - Returned jobs now have a
metadataproperty. PR #21.
- Implement the FNV (Fowler–Noll–Vo) hashing algorithm in the project and drop dependency on the
fnv-hashgem. PR #14.
- Implement unique job insertion. PR #10.
- Implement
#insert_manyfor batch job insertion. PR #5.
- Initial implementation that supports inserting jobs using either ActiveRecord or Sequel. PR #1.