Skip to Content

@revideo/core


@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

ThreadsFactory

A function that returns the generator to run.

callback?

ThreadsCallback

Called whenever threads are created, canceled or finished. Used for debugging purposes.

Returns

ThreadGenerator

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
© 2026 Haven Technologies, Inc.
Function: threads() – Revideo