Registry / devops / seneca-queue

seneca-queue

JSON →
library0.3.0jsnpmunverified

A multi-transport job queue plugin for the Seneca.js microservices framework, allowing creation and management of task queues with support for in-memory and custom transports (e.g., Amazon SQS). Version 0.3.0 is the current stable release, with low release cadence (last update years ago). It provides start/stop/enqueue commands, concurrency control, and round-robin distribution across multiple processes. Differentiator: integrates deeply with Seneca's action patterns, enabling queue-driven microservices without external dependencies for basic use.

npm install seneca-queue
INSTALL
IMPORT
SIG · SENECA-QUEUE
S
seneca-queue
devopsjavascriptv0.3.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

plugin (use require)
require('seneca')()
import Seneca from 'seneca'
Seneca and this plugin are typically used with CommonJS require. ESM imports may work but are not officially supported.
seneca-queue
s.use('queue')
s.use(require('seneca-queue'))
The plugin is loaded by name string 'queue' after npm install. Using require and passing the reference is also valid but less common.
role:queue actions
s.act({ role: 'queue', cmd: 'enqueue', msg: task })
s.act({ role: 'queue', cmd: 'enqueue', task: task })
The task message must be under 'msg' property, not directly on the action object.

Sets up an in-memory queue, defines a worker for 'my task', enqueues a message, and stops the queue after processing.

const s = require('seneca')() s.use('queue') s.add({ task: 'my task' }, (args, cb) => { console.log('Processed:', args.param) cb() s.act({ role: 'queue', cmd: 'stop' }) }) s.act({ role: 'queue', cmd: 'start' }) s.act({ role: 'queue', cmd: 'enqueue', msg: { task: 'my task', param: 42 } })
Debug
Known issues
deprecatedseneca-queue is in maintenance mode with no recent updates; use at your own risk for new projects.
fix
Consider using modern job queues like Bull or Bee-Queue for new projects.
affects: *
gotchaConcurrency option currently only works with the in-memory queue, not custom transports.
fix
For custom transports, concurrency must be handled in the transport implementation.
affects: <=0.3.0
gotchaActions must be added before starting the queue, otherwise tasks may be processed by handlers not yet registered.
fix
Always add action patterns (s.add) before calling s.act({ role: 'queue', cmd: 'start' }).
affects: *
gotchaThe queue will stop processing tasks if a worker fails; the failing server is blacklisted and won't receive new tasks.
fix
Implement proper error handling and retry logic in workers to avoid blacklisting.
affects: <=0.3.0
Errors
Common errors & fixes
Error: No handler for cmd:enqueue,role:queue
Queue plugin not registered or role option changed.
fix
Ensure s.use('queue') is called before s.act({ role: 'queue', cmd: 'enqueue', ... }).
TypeError: Cannot read property 'act' of undefined
Seneca instance not initialized correctly.
fix
Use const s = require('seneca')() to create the instance.
Error: No action found for pattern task:my task
Worker action not added before queue was started.
fix
Add s.add({ task: 'my task' }, handler) before s.act({ role: 'queue', cmd: 'start' }).
Upgrade
Version history
0.3.0latest on npm
Audit
Dependencies
senecarequiredPeer dependency; the plugin is designed to work with Seneca.js
Agent activity
5 hits · last 30 days
node
4
Resources
seneca-queue — npm install seneca-queue · libregistry