1.0.0-pre-4 • Published 7 months ago

@monolayer/task-bullmq-adapter v1.0.0-pre-4

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

task-bullmq-adapter

BullMQ adapter for task workloads from @monolayer/workloads.

Requirements

  • @monolayer/workloads package.
  • Redis server.

Usage

  • Add package

    npm install @monolayer/task-bullmq-adapter
  • Set MONO_TASK_MODE environment variable to bull

    export MONO_TASK_MODE=bull
  • Set MONO_TASK_REDIS_URL environment variable with the Redis instance connection string

    export 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()
1.0.0-pre-4

7 months ago

1.0.0-pre-3

7 months ago

1.0.0-pre-2

7 months ago

1.0.0-pre-1

7 months ago