Skip to content

Instantly share code, notes, and snippets.

@Senhaji-Rhazi-Hamza
Created November 12, 2021 16:25
Show Gist options
  • Select an option

  • Save Senhaji-Rhazi-Hamza/d58dff1cb6c2e000e64620d66cc4d650 to your computer and use it in GitHub Desktop.

Select an option

Save Senhaji-Rhazi-Hamza/d58dff1cb6c2e000e64620d66cc4d650 to your computer and use it in GitHub Desktop.
// worker.js
import celery from "celery-node";
import celeryConfig from './config.js'
import {add} from './tasks/example/arithmetic.js'
const worker = celery.createWorker(
celeryConfig.BROKER_URL,
celeryConfig.CELERY_RESULT_BACKEND,
celeryConfig.QUEUE // default js-queue
);
worker.register("js_workers.tasks.example.arithmetic.add", add);
worker.start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment