List of builtin modules available to tasks run by this scheduler. Each module's environment (native functions, patterns, variables) will be included in the search path for new tasks.
OptionalprintHook: (x: string) => voidCalled with a string whenever a task calls the Backolon print function.
Can be used to capture printed output in a custom environment (e.g. a web REPL).
Names of special classes to preserve when serializing the scheduler's state with serializeTasks and loadFromSerialized.
See the Resurrect.js library documentation for details.
List of builtin modules available to tasks run by this scheduler. Each module's environment (native functions, patterns, variables) will be included in the search path for new tasks.
OptionalprintCalled with a string whenever a task calls the Backolon print function.
Can be used to capture printed output in a custom environment (e.g. a web REPL).
Maximum allowed stack length before a task throws a recursion error. Backolon uses its own stack and not the JavaScript call stack, so this serves to prevent out-of-memory errors.
List of currently active tasks, sorted by priority (lowest first). Tasks that have finished executing but haven't been removed from the list yet will have an empty stack.
Deserializes a string produced by serializeTasks and adds the resulting tasks to the scheduler.
Note that the deserialized tasks will share the same Scheduler instance (this) as each other and any tasks that were already in the scheduler,
but will not share any state with tasks that were already in the scheduler before (e.g. they won't share environments or variables).
Dumps the state of all tasks into a string, which can later be loaded with loadFromSerialized to restore the tasks and their states.
Start a new task with the given code and environment. The code can be provided as a string (in which case it will be parsed) or as a pre-parsed Thing. The environment is a list of env Things, which will be searched in order when looking up variables; if null or omitted, the environments of all builtin modules will be used.
The new Task will have its top-level block in a new environment that has the provided envs as parents, so changes to the top-level block's environment won't affect the provided envs or other tasks that share those envs.
Start a new task with the given code and environment. The code can be provided as a string (in which case it will be parsed) or as a pre-parsed Thing. The environment is a list of env Things, which will be searched in order when looking up variables; if null or omitted, the environments of all builtin modules will be used.
The new Task will have its top-level block in a new environment that has the provided envs as parents, so changes to the top-level block's environment won't affect the provided envs or other tasks that share those envs.
Run tasks until all tasks are suspended or complete or the optional maxSteps limit is reached (-1 or undefined means no limit). Returns true if any progress was made (i.e. any task executed at least one step).
Backolon task scheduler responsible for running code and native functions.