Registry / messaging / oly-queue

oly-queue

JSON →
library1.0.0jsnpmunverified

A task queue library for TypeScript applications, built on top of Bull and integrated with the Oly dependency injection framework. Current version is 1.0.0. It provides decorators for defining tasks, a worker provider for processing tasks, and a publisher for pushing tasks and waiting for results. Differentiators include tight coupling with Oly for declarative job definitions and result waiting.

npm install oly-queue
INSTALL
IMPORT
SIG · OLY-QUEUE
O
oly-queue
messagingjavascriptv1.0.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.

task
import { task } from 'oly-queue'
import task from 'oly-queue'
Named export, not default export
WorkerProvider
import { WorkerProvider } from 'oly-queue'
Named export for creating worker instances
Publisher
import { Publisher } from 'oly-queue'
Named export for pushing jobs and waiting for results.

Defines a simple task class using @task decorator, creates a kernel with WorkerProvider, gets a Publisher, pushes a job, and waits for the result.

import { task, WorkerProvider, Publisher } from 'oly-queue'; import { Kernel } from 'oly'; class App { @task add({ x, y }: { x: number; y: number }) { return x + y; } } const kernel = Kernel.create().with(App, WorkerProvider); const publisher = kernel.get(Publisher); await kernel.start(); const job = await publisher.push('App.add', { x: 1, y: 2 }); const result = await publisher.wait(job); console.log(result); // 3 await kernel.stop();
Debug
Known issues
breakingRequires peer dependency 'oly' version ^0.15.1
fix
Ensure 'oly@^0.15.1' is installed in your project.
affects: >=1.0.0
gotchaThe @task decorator cannot be used on static methods or functions outside a class instance managed by Oly kernel.
fix
Always define tasks as instance methods on a class that is registered with the kernel.
affects: >=1.0.0
deprecatedThe 'WorkerProvider' and 'Publisher' are required to be provided explicitly; they may be replaced or merged in future versions.
fix
Monitor changelog for updates on provider/dependency injection changes.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'oly-queue'
Package not installed or not in node_modules
fix
npm install oly-queue
TypeError: Cannot read properties of undefined (reading 'push')
Publisher not retrieved from kernel before calling push
fix
Ensure you call kernel.get(Publisher) after kernel.create()
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies
olyrequiredCore dependency for dependency injection and kernel management
Agent activity
10 hits · last 30 days
node
8
Amazon
1
OpenAI (training)
1
Resources
oly-queue — npm install oly-queue · libregistry