@revideo/core / threading / threads
Function: threads()
threads(
factory,callback?):ThreadGenerator
Defined in: threading/threads.ts:56
Create a context in which generators can be run concurrently.
Parameters
factory
A function that returns the generator to run.
callback?
Called whenever threads are created, canceled or finished. Used for debugging purposes.
Returns
Remarks
From the perspective of the external generator, threads is executed
synchronously. By default, each scene generator is wrapped in its own
threads generator.
Example
// first
yield* threads(function* () {
const task = yield generatorFunction();
// second
}); // <- `task` will be terminated here because the scope
// of this `threads` generator has ended
// third