1.0.8 • Published 6 months ago

amqp-workflow v1.0.8

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

insipred from amqp-delegate

don't setup queue yourself, will automatically do it based on config

const { makeWorker, makeDelegator } = require("amqp-workflow");
const fetch = require("node-fetch");

const namespace = "amqp"; // default namespace const url = "amqp://username:password@localhost:5672";

makeWorker({ name: "gd.docs", task: ({ appNo }) => ({ s3_path: ${appNo}.xxx.pdf }), url, }) .start() .then(() => { // const mgmt_list_queues = "http://localhost:15672/api/queues"; // const toBase64 = (text) => Buffer.from(text).toString("base64"); // fetch(mgmt_list_queues, { // headers: { Authorization: Basic ${toBase64("username:password")} }, // }) // .then((r) => r.json()) // .then((r) => // console.log( // available under ${namespace}, // r.reduce((m, { name }) => { // if (name.startsWith(${namespace}.)) m.push(name); // return m; // }, []) // ) // ); });

const workflow = makeDelegator({ url }); workflow .start() .then(() => workflow.invoke("gd.docs", { appNo: "US12345678" })) .then(console.log);

1.0.8

6 months ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.3

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago