MCPcopy Index your code
hub / github.com/hackmdio/codimd / process

Method process

lib/realtime/processQueue.js:86–103  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

84 }
85
86 process () {
87 if (this.queue.length <= 0) {
88 this.stop()
89 this.lock = false
90 return
91 }
92
93 const task = this.queue.shift()
94 this.taskMap.delete(task.id)
95
96 const finishTask = () => {
97 this.lock = false
98 setImmediate(() => {
99 this.emit(QueueEvent.Finish)
100 })
101 }
102 task.processingFunc().then(finishTask).catch(finishTask)
103 }
104}
105
106exports.ProcessQueue = ProcessQueue

Callers 1

onEventProcessFuncMethod · 0.95

Calls 1

stopMethod · 0.95

Tested by

no test coverage detected