{"id":44201,"library":"adonis-resque","title":"adonis-resque","description":"Third-party queue wrapper for AdonisJS v6 using node-resque with Redis backend. Current version 2.0.2, stable, actively maintained. Supports basic, batch, delayed, and repeated job enqueuing, worker management, scheduler, failure handling, dependency injection in jobs, and plugins (jobLock, queueLock, retry, noop). Not compatible with AdonisJS v5. Ships TypeScript types, requires @adonisjs/core ^6.12.1 and @adonisjs/redis ^9.1.0. Key differentiators: AdonisJS native integration, sub-path imports for jobs, and built-in plugin system.","status":"active","version":"2.0.2","language":"javascript","source_language":"en","source_url":"https://github.com/shiny/adonis-resque","tags":["javascript","adonisjs","adonis6","resque","node-resque","queue","typescript"],"install":[{"cmd":"npm install adonis-resque","lang":"bash","label":"npm"},{"cmd":"yarn add adonis-resque","lang":"bash","label":"yarn"},{"cmd":"pnpm add adonis-resque","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required by AdonisJS application ecosystem","package":"@adonisjs/core","optional":false},{"reason":"Required for Redis connection used by node-resque","package":"@adonisjs/redis","optional":false},{"reason":"Core library providing the Resque queue implementation","package":"node-resque","optional":false}],"imports":[{"note":"ESM-only package (AdonisJS v6). Named export, not default.","wrong":"const BaseJob = require('adonis-resque').BaseJob","symbol":"BaseJob","correct":"import { BaseJob } from 'adonis-resque'"},{"note":"Named export. Default export is not available.","wrong":"import Worker from 'adonis-resque'","symbol":"Worker","correct":"import { Worker } from 'adonis-resque'"},{"note":"Export name is Queue, not ResqueQueue.","wrong":"import { ResqueQueue } from 'adonis-resque'","symbol":"Queue","correct":"import { Queue } from 'adonis-resque'"},{"note":"Requires sub-path import configuration in package.json and tsconfig.json.","wrong":"import Example from './app/jobs/example'","symbol":"#jobs/*","correct":"import Example from '#jobs/example'"}],"quickstart":{"code":"// 1. Install and configure\n// npm install adonis-resque@2.0.0-alpha.0\n// node ace configure adonis-resque\n\n// 2. Create a job file (app/jobs/send_email.ts)\nimport { BaseJob } from 'adonis-resque'\nimport logger from '@adonisjs/core/services/logger'\n\nexport default class SendEmail extends BaseJob {\n  static get $$filepath() { return __filename }\n\n  async perform(email: string, subject: string) {\n    // Simulate sending email\n    logger.info(`Sending email to ${email} with subject: ${subject}`)\n    // Actual mail sending logic here\n  }\n}\n\n// 3. Enqueue the job from a controller or service\nimport SendEmail from '#jobs/send_email'\n\nexport default class UserController {\n  async register({ request, response }) {\n    const { email } = request.all()\n    // Dispatch background job\n    await SendEmail.enqueue(email, 'Welcome!')\n    // Or with delay (5 minutes)\n    // await SendEmail.enqueue(email, 'Welcome!', { delay: 300 })\n    return response.ok({ message: 'User registered and email queued' })\n  }\n}\n\n// 4. Start the worker (e.g., in a separate process or via ace command)\n// node ace resque:worker\n\n// 5. Start the scheduler for delayed jobs\n// node ace resque:scheduler","lang":"typescript","description":"Shows installation, creating a job class, enqueuing a background task from a controller, and starting worker/scheduler processes."},"warnings":[{"fix":"Use adonis-resque v1.x for AdonisJS v5.","message":"Not compatible with AdonisJS v5.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Use `import logger from '@adonisjs/core/services/logger'` in job files.","message":"v2 removed `this.logger` from job instances; logger must be injected or imported separately.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Replace `Job.enqueue(args).delay(300)` with `Job.enqueue(args, { delay: 300 })`.","message":"v2 removed chainable methods (e.g., `.delay()`); use options object instead.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Use `constructor(@inject() private someService: SomeService) {}` in job class.","message":"Jobs are not `@injectable`; dependency injection is available only via container in the job's constructor.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Add `\"#jobs/*\": [\"./app/jobs/*.js\"]` to `package.json` exports and `tsconfig.json` paths.","message":"Requires sub-path imports configuration in both `package.json` and `tsconfig.json` for `#jobs/*` to work.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'2.0.2':21 '6.12.1':58 '9.1.0':61 'activ':23 'adoni':2 'adonis-resqu':1 'adonis6':81 'adonisj':10,51,64,80 'adonisjs/core':57 'adonisjs/redis':60 'backend':18 'basic':26 'batch':27 'built':75 'built-in':74 'compat':49 'current':19 'delay':28 'depend':38 'differenti':63 'enqueu':32 'failur':36 'handl':37 'import':70 'inject':39 'integr':66 'javascript':79 'job':31,41,72 'joblock':44 'key':62 'maintain':24 'manag':34 'nativ':65 'node':14,84 'node-resqu':13,83 'noop':47 'parti':6 'path':69 'plugin':43,77 'queue':7,86 'queuelock':45 'redi':17 'repeat':30 'requir':56 'resqu':3,15,82,85 'retri':46 'schedul':35 'ship':53 'stabl':22 'sub':68 'sub-path':67 'support':25 'system':78 'third':5 'third-parti':4 'type':55 'typescript':54,87 'use':12 'v5':52 'v6':11 'version':20 'worker':33 'wrapper':8","created_at":"2026-06-07T12:48:58.538901+00:00","updated_at":"2026-06-07T12:48:58.538901+00:00","problems":[{"fix":"Add `\"#jobs/*\": [\"./app/jobs/*.js\"]` to `package.json` under `exports` and to `tsconfig.json` under `compilerOptions.paths`.","cause":"Missing sub-path import configuration in package.json or tsconfig.json.","error":"Cannot find module '#jobs/example' or its corresponding type declarations."},{"fix":"Use `await Job.enqueue(args, { delay: 300 })` instead of chaining.","cause":"Using v2 code with v1 chainable API; delay method was removed.","error":"TypeError: Job.enqueue(...).delay is not a function"},{"fix":"Import logger separately: `import logger from '@adonisjs/core/services/logger'`.","cause":"v2 removed `this.logger` from job instances.","error":"Property 'logger' does not exist on type 'YourJob'."}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/shiny/adonis-resque","github":"https://github.com/shiny/adonis-resque","docs":null,"changelog":null,"pypi":null,"npm":"adonis-resque","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}