Skip to content

7.0.0

Compare
Choose a tag to compare
@timgit timgit released this 17 Dec 01:01
· 169 commits to master since this release
8d34ab7

Publish/Subscribe 🎉

The primary theme of v7 is changing the semantics of the API to introduce a publish/subscribe feature that more closely aligns with other queue & messaging products that use a fan-out relationship between an event and subscription. Previously, pg-boss used publish() for "create a new job" and subscribe() for "poll a queue on an interval and execute a function".

  • MAJOR: publish() renamed to send()
  • MAJOR: subscribe() renamed to work()
  • MAJOR: New pub/sub functions added for fan-out relationships between events and queues.
    • subscribe() will register a named event to a queue
    • publish() will add a job to each subscribed queue per event
    • Thanks to @tcoats for the PR to add this!
  • teamRefill option added to work() when using teamSize to prevent longer-running jobs from delaying job processing in the worker.