{"id":46819,"library":"worque","title":"worque - AMQP Work Queue","description":"A lightweight AMQP-based work queue library (v0.11.2, last updated 2015) for Node.js that provides durable, persistent task processing via RabbitMQ. Key features include one-by-one task processing (RabbitMQ 3.3+), cron scheduling, configurable retry with exponential backoff, and a fluent API using promises. Unlike generic AMQP libraries, worque simplifies task definition and lifecycle management with built-in events and scheduling. It relies on AMQP URLs and uses an event-driven model for task lifecycle. The package is stable but in maintenance mode; no recent updates.","status":"maintenance","version":"0.11.2","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/titarenko/worque","tags":["javascript","work","task","queue","amqp","rabbitmq","durable","persistent","promise"],"install":[{"cmd":"npm install worque","lang":"bash","label":"npm"},{"cmd":"yarn add worque","lang":"bash","label":"yarn"},{"cmd":"pnpm add worque","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"AMQP client for RabbitMQ","package":"amqplib","optional":false}],"imports":[{"note":"ESM default import. Requires AMQP URL string as first argument.","wrong":"const worque = require('worque')()","symbol":"default","correct":"import worque from 'worque'"},{"note":"Type imports only available if package includes types (v0.11.2 does not ship TS types).","wrong":"const Task = require('worque').Task","symbol":"Task","correct":"import type { Task } from 'worque'"},{"note":"subscribe is a method on the task instance, not on the client.","wrong":"const client = require('worque'); client.subscribe('task', handler)","symbol":"subscribe","correct":"const client = worque('amqp://localhost'); client('task').subscribe(handler)"}],"quickstart":{"code":"import worque from 'worque';\n\nconst client = worque('amqp://localhost');\n\nclient.on('task', (msg) => console.log('Task received:', msg));\nclient.on('result', (msg) => console.log('Task completed:', msg));\nclient.on('failure', (err) => console.error('Task failed:', err));\n\nclient('logthis').subscribe((message) => {\n  console.log(message);\n});\n\nclient('logthis').publish({ something: 42 });\n\nclient('recurrent task runs each minute').subscribe(() => {\n  console.log('I run each minute');\n}).schedule('0 * * * * *');\n\nclient('retry 3 times if failed').subscribe((url) => {\n  return doRequestAndSaveToFile(url);\n}).retry(1, 2, 3).publish('http://mysite.com');\n\nprocess.on('SIGINT', () => {\n  client.close();\n});","lang":"typescript","description":"Sets up a worque client, defines two tasks (immediate and scheduled), publishes a message, and handles graceful shutdown."},"warnings":[{"fix":"Upgrade RabbitMQ to 3.3+ or handle concurrency manually.","message":"One-by-one task processing is only guaranteed with RabbitMQ 3.3 and higher.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use native async/await or your own promise library; avoid relying on Bluebird-specific methods.","message":"Package uses Bluebird promises internally but does not expose them in the public API.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Implement your own worker pool or use a queue middleware like Bull or Bee-Queue for distributed processing.","message":"All tasks are processed in the same Node.js process; no built-in distribution across workers.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Set the server timezone or adjust your cron expression accordingly.","message":"The schedule function uses cron expressions but may not handle timezone offsets; cronjob runs in server local time.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'2015':16 '3.3':37 'amqp':2,8,53,72,99 'amqp-bas':7 'api':48 'backoff':44 'base':9 'built':64 'built-in':63 'configur':40 'cron':38 'definit':58 'driven':79 'durabl':21,101 'event':66,78 'event-driven':77 'exponenti':43 'featur':28 'fluent':47 'generic':52 'includ':29 'javascript':95 'key':27 'last':14 'librari':12,54 'lifecycl':60,83 'lightweight':6 'mainten':90 'manag':61 'mode':91 'model':80 'node.js':18 'one':31,33 'one-by-on':30 'packag':85 'persist':22,102 'process':24,35 'promis':50,103 'provid':20 'queue':4,11,98 'rabbitmq':26,36,100 'recent':93 'reli':70 'retri':41 'schedul':39,68 'simplifi':56 'stabl':87 'task':23,34,57,82,97 'unlik':51 'updat':15,94 'url':73 'use':49,75 'v0.11.2':13 'via':25 'work':3,10,96 'worqu':1,55","created_at":"2026-06-07T13:01:47.160771+00:00","updated_at":"2026-06-07T13:01:47.160771+00:00","problems":[{"fix":"Run 'npm install worque --save' in your project directory.","cause":"worque not installed or npm install failed.","error":"Error: Cannot find module 'worque'"},{"fix":"Start RabbitMQ server or change the AMQP URL to the correct host.","cause":"RabbitMQ is not running or connection URL is wrong.","error":"Error: connect ECONNREFUSED 127.0.0.1:5672"},{"fix":"Use const client = require('worque')('amqp://localhost');","cause":"Calling require('worque') directly instead of require('worque')(url).","error":"TypeError: client is not a function"},{"fix":"Ensure each task has only one subscription, or combine handlers.","cause":"Attempting to subscribe to the same task twice.","error":"Error: task 'name' already has a subscriber"}],"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/titarenko/worque","github":"ssh://git@github.com/titarenko/worque","docs":null,"changelog":null,"pypi":null,"npm":"worque","openapi_spec":null,"status_page":null,"smithery":null,"categories":["messaging"],"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}}