MCPcopy Index your code
hub / github.com/easydiffusion/easydiffusion / enqueue

Method enqueue

ui/media/js/engine.js:656–669  ·  view source on GitHub ↗
(promiseGenerator, ...args)

Source from the content-addressed store, hash-verified

654 }
655
656 async enqueue(promiseGenerator, ...args) {
657 if (this.status !== TaskStatus.init) {
658 throw new Error(`Task is in an invalid status ${this.status} to add to queue.`)
659 }
660 this._setStatus(TaskStatus.pending)
661 task_queue.set(this, promiseGenerator)
662 await eventSource.fireEvent(EVENT_TASK_QUEUED, { task: this })
663 await Task.enqueue(promiseGenerator, ...args)
664 await this.waitUntil({ status: TaskStatus.completed })
665 if (this.exception) {
666 throw this.exception
667 }
668 return this.result
669 }
670 static async enqueue(promiseGenerator, ...args) {
671 if (typeof promiseGenerator === "undefined") {
672 throw new Error("To enqueue a concurrent task, a *Promise Generator is needed but undefined was found.")

Callers 2

onTaskStartFunction · 0.45
jasmineSpec.jsFile · 0.45

Calls 5

_setStatusMethod · 0.95
waitUntilMethod · 0.95
waitUntilFunction · 0.85
fireEventMethod · 0.80
getMethod · 0.80

Tested by

no test coverage detected