Skip to content

Releases: actionhero/node-resque

v5.1.0: Locks and BusyBox

27 Dec 20:10
Compare
Choose a tag to compare

Clear locks from QueueLock when a job is popped rather than successful.

Support for BusyBox Linux

Changes the way we detect running PIDs on Linux/Unix/OSX to be more compatible.

Fix Typos in Readme

v4.0.9

03 Oct 19:11
Compare
Choose a tag to compare

The changes from https://github.com/taskrabbit/node-resque/releases/tag/v5.0.2 are backported to the v4 branch

v5.0.2: PluginRunner Fix

02 Oct 22:39
Compare
Choose a tag to compare

Fixes a bug which prevented plugins defined by a function from being run.

v5.0.1: faster check for de-duplication in delayed queues

29 Sep 20:16
Compare
Choose a tag to compare

Check if job already exists in queue

  • Instead of getting the full set (smembers), and iterating through it, just use sismember.
  • by @SGKumar via #215

misc

  • clarify methods in readme

v5.0.0: Async/Await

21 Sep 22:05
Compare
Choose a tag to compare

Version 5.0 rewrites node-resque to use Async/Await syntax rather than callbacks.

Check out the examples & README for more information on the updated APIs.

Node.js version v8.0.0 and above is now required to run this project.

Breaking Changes

  • Every callback-based method API in the package has changed to become an async method.
    • Errors now throw rather than return an Error object.
    • You can use try/catch to decide what to do with errors in your project
    • for example:
try {
  const queue = new NodeResque.Queue({connection: connectionDetails}, jobs)
  queue.on('error', function (error) { throw error })
  await queue.connect()
} catch (error) {
  console.error(`Queue Connection Error: ${error}`)
}

try {
  await queue.enqueue('math', 'add', [1, 2])
  await queue.enqueue('math', 'add', [1, 2])
  await queue.enqueue('math', 'add', [2, 3])
  await queue.enqueueIn(3000, 'math', 'subtract', [2, 1])
} catch (error) {
  console.error(`Enqueue Error: ${error}`)
}
  • Jobs' perform methods should now be async methods that return a response value, for example:
const jobs = {
  'Sleep Add': {
    plugins: ['JobLock'],
    pluginOptions: {
      JobLock: {}
    },
    perform: async (a, b) => {
      let answer = a + b
      await new Promise((resolve) => { setTimeout(resolve, 1000) })
      return answer
    }
  }
}
  • Plugins now inherit from NodeResque.Plugin, for example:
const NodeResque = require('node-resque')

class MyPlugin extends NodeResque.Plugin {
  beforeEnqueue () {
    // console.log("** beforeEnqueue")
    return true // should the job be enqueued?
  }

  afterEnqueue () {
    // console.log("** afterEnqueue")
  }

  beforePerform () {
    // console.log("** beforePerform")
    return true // should the job be run?
  }

  afterPerform () {
    // console.log("** afterPerform")
  }
}
  • All classes now follow proper convention of having capitol letter names, ie NodeResque.Plugin
  • Plugin lifecycles are now camel case: beforeEnqueue, afterEnqueue, beforePerform, afterPerform
  • Plugin lifecycle methods are now async methods, with no callback (per the above)

v4.0.8: Ensure that toRun is passed to enqueue even with an error.

21 Aug 22:46
Compare
Choose a tag to compare

If you are enqueuing a job which fails with an error, we weren't properly returning toRun (which would be false) as well. We are now!

v4.0.7: Fix call callback for stopMultiWorker before stop all workers

08 Jun 16:58
Compare
Choose a tag to compare

In some cases stop callback for multiWorker called before all workers stopped.
It's happened through calling self.workers.pop() in checkWorkers method, and check self.workers.length === 0 in stopWait.

v4.0.6

18 May 17:18
Compare
Choose a tag to compare
  • Project now includes a linter as part of the test suite via standardjs.com (#184)
  • Support for string'd errors from a worker (#188)
  • Update ioredis to v3.x.x (#204)

v4.0.5 Retry keys

15 Nov 15:55
Compare
Choose a tag to compare

Fix an issue with the retry plugin in which keys for complex args were being stored as [Object object] in all cases

v4.0.4: Bugfix

01 Nov 05:48
Compare
Choose a tag to compare
  • fix bug which might cause multiWorker to always work less than minTaskProcessors