
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
loopback-mongo-queue
Advanced tools
loopback mongo based queue
Queue:
dataSource: "mongo"
public: false
Workflow:
dataSource: "mongo"
public: false
Task:
dataSource: "mongo"
Worker:
dataSource: false
public: false
Log:
dataSource: false
public: false
Profiler:
dataSource: false
public: false
Step:
dataSource: false
public: false
module.exports = (app) ->
{ Worker, Queue, Workflow, Task } = app.models
fns =
uppercase: (task, callback) ->
{ params } = task
@log.info 'setting ' + params.text + ' to upper case'
@log.error new Error 'testing error'
setTimeout ->
uppercase = params.text.toUpperCase()
callback null, uppercase
, 3000
prepend: (task, callback) ->
{ results } = task
@log.info 'add foo to ' + results
@log.error new Error 'testing error'
text = 'foo ' + results
callback null, text
worker = new Worker()
worker.register fns
# registers global functions
Worker.create fns
worker.on 'dequeued', (data) ->
console.log 'Dequeued:'
console.log data
worker.on 'failed', (data) ->
console.log 'Failed:'
console.log data
worker.on 'complete', (data) ->
console.log 'Complete:'
console.log data
worker.on 'error', (err) ->
console.log 'Error:'
console.log err
worker.stop()
worker.start()
enqueued = (err, job) ->
if err
throw err
console.log 'Enqueued:', job
Task.create
chain: 'uppercase'
params:
text: 'bar'
, enqueued
queue = new Queue
name: 'foo'
queue.enqueue 'uppercase', { text: 'bar' }, enqueued
workflow = new Workflow
name: 'my workflow'
chain: [ 'uppercase', 'prepend' ]
workflow.enqueue { text: 'bar' }, enqueued
{
"chain": [
"uppercase"
],
"events": {
"uppercase": {
"started": "2017-01-21T10:49:40.442Z",
"ended": "2017-01-21T10:49:43.446Z",
"logs": [
{
"args": [
"setting bar to upper case"
],
"time": "2017-01-21T10:49:40.444Z",
"type": "info"
},
{
"args": [
"error.message", "error.stack"
],
"time": "2017-01-21T10:49:40.444Z",
"type": "error"
}
]
}
},
"status": "complete",
"params": {
"text": "bar"
},
"queue": "foo",
"count": 0,
"delay": "2017-01-21T10:49:34.943Z",
"priority": 0,
"ended": "2017-01-21T10:49:43.447Z",
"enqueued": "2017-01-21T10:49:34.943Z",
"result": "BAR",
"id": "58833cbff73b6ed1ec9f8f91",
"dequeued": "2017-01-21T10:49:40.434Z"
}
FAQs
loopback mongo based queue
The npm package loopback-mongo-queue receives a total of 6 weekly downloads. As such, loopback-mongo-queue popularity was classified as not popular.
We found that loopback-mongo-queue demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.