MCPcopy Create free account
hub / github.com/easydiffusion/easydiffusion / run

Method run

ui/media/js/engine.js:702–722  ·  view source on GitHub ↗
(promiseGenerator, { callback, signal, timeout = -1 } = {})

Source from the content-addressed store, hash-verified

700 }
701
702 static async run(promiseGenerator, { callback, signal, timeout = -1 } = {}) {
703 let value = undefined
704 let done = undefined
705 if (timeout < 0) {
706 timeout = Number.MAX_SAFE_INTEGER
707 }
708 timeout = Date.now() + timeout
709 do {
710 ; ({ value, done } = await Promise.resolve(promiseGenerator.next(value)))
711 if (value instanceof Promise) {
712 value = await value
713 }
714 if (callback) {
715 ; ({ value, done } = await Promise.resolve(callback.call(promiseGenerator, { value, done })))
716 }
717 if (value instanceof Promise) {
718 value = await value
719 }
720 } while (!done && !signal?.aborted && timeout > Date.now())
721 return value
722 }
723 static async *asGenerator({ callback, generator, signal, timeout = -1 } = {}) {
724 let value = undefined
725 let done = undefined

Callers 9

launch_uvicornFunction · 0.45
runMethod · 0.45
runMethod · 0.45
engine.jsFile · 0.45
uFunction · 0.45
ftFunction · 0.45
jasmineSpec.jsFile · 0.45
jasmine.jsFile · 0.45
runNextFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected