@rpcbase/server 0.103.0 → 0.104.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/queue/index.js +3 -0
package/package.json
CHANGED
package/queue/index.js
CHANGED
|
@@ -10,6 +10,9 @@ const tasks_list = Object.create(null)
|
|
|
10
10
|
let worker_queue
|
|
11
11
|
|
|
12
12
|
const worker_add = async(task_name, payload, options) => {
|
|
13
|
+
if (!worker_queue) {
|
|
14
|
+
worker_queue = new Queue("worker-queue", worker_queue_url)
|
|
15
|
+
}
|
|
13
16
|
const res = await worker_queue.add({task_name, payload}, options)
|
|
14
17
|
console.log("created task:", task_name, res.id)
|
|
15
18
|
console.log(payload)
|