How to use ironium - 1 common examples

To help you get started, we’ve selected a few ironium examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github willvincent / adonis-ironium / src / Ironium / index.js View on Github external
init () {
    if (!this._instance) {
      const config = this.config[this.config.service]
      if (this.config.prefix) config.prefix = this.config.prefix
      if (this.config.concurrency) config.concurrency = this.config.concurrency
      if (this.config.canStartQueue) config.canStartQueue = this.config.canStartQueue
      ironium.configure(config)

      this._instance = ironium

      if (this.config.log_errors) {
        this._instance.onerror(function (error, subject) {
          this.Logger.error(`IRONIUM :: Error reported by: ${subject}`)
          this.Logger.error(error.stack)
        })
      }

      for (const job of this.jobs) {
        this._instance.queue(job.constructor.name).eachJob(job.handle)
      }
    }
  }

ironium

Job queues and scheduled jobs for Node.js backed by Beanstalk/IronMQ/SQS.

MIT
Latest version published 3 years ago

Package Health Score

45 / 100
Full package analysis

Popular ironium functions