1.0.0-pre-4 • Published 7 months ago
@monolayer/task-bullmq-adapter v1.0.0-pre-4
task-bullmq-adapter
BullMQ adapter for task workloads from @monolayer/workloads.
Requirements
@monolayer/workloadspackage.- Redis server.
Usage
Add package
npm install @monolayer/task-bullmq-adapterSet
MONO_TASK_MODEenvironment variable tobullexport MONO_TASK_MODE=bullSet
MONO_TASK_REDIS_URLenvironment variable with the Redis instance connection stringexport MONO_TASK_REDIS_URL=redis-connection-string
Dispatcher
Run your application with the task workload.
Worker
Wrap your task in a worker script.
import { Worker } from "@monolayer/task-bullmq-adapter";
import task from "/path/to/task.js" // Build output from workloads build
new Worker(task.default);You can stop the worker with:
worker.stop()