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

Method push

lib/realtime/processQueue.js:72–84  ·  view source on GitHub ↗

* pushWithKey a promisify-task to queue * @param id {string} * @param processingFunc {Function } * @returns {boolean} if success return true, otherwise false

(id, processingFunc)

Source from the content-addressed store, hash-verified

70 * @returns {boolean} if success return true, otherwise false
71 */
72 push (id, processingFunc) {
73 if (this.queue.length >= this.max) return false
74 if (this.checkTaskIsInQueue(id)) return false
75 const task = {
76 id: id,
77 processingFunc: processingFunc
78 }
79 this.taskMap.set(id, true)
80 this.queue.push(task)
81 this.start()
82 this.emit(QueueEvent.Push)
83 return true
84 }
85
86 process () {
87 if (this.queue.length <= 0) {

Callers 15

createHttpServerFunction · 0.45
selectRevisionFunction · 0.45
updateScrollspyFunction · 0.45
updateAuthorshipInnerFunction · 0.45
iterateLineFunction · 0.45
deduplicateOnlineUsersFunction · 0.45
partialUpdateFunction · 0.45
checkAboveFunction · 0.45
checkBelowFunction · 0.45
index.jsFile · 0.45
clearDuplicatedHistoryFunction · 0.45
addHistoryFunction · 0.45

Calls 3

checkTaskIsInQueueMethod · 0.95
startMethod · 0.95
setMethod · 0.80

Tested by

no test coverage detected