Bakes
Defined in: sdk/src/runtime/bakes.ts:51
The jobs an App is running. Read Bakes.active for what to show.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Bakes():
Bakes
Returns
Section titled “Returns”Bakes
Properties
Section titled “Properties”budgetMs
Section titled “budgetMs”budgetMs:
number=8
Defined in: sdk/src/runtime/bakes.ts:53
How long, in milliseconds, all the work spread over frames may take of one frame between it.
priorityExtraMs
Section titled “priorityExtraMs”priorityExtraMs:
number=12
Defined in: sdk/src/runtime/bakes.ts:55
How much more a frame gives while work that would be seen missing is still to do (see urge).
Accessors
Section titled “Accessors”active
Section titled “active”Get Signature
Section titled “Get Signature”get active():
BakeProgress[]
Defined in: sdk/src/runtime/bakes.ts:101
Every piece of work in hand now. Empty when the engine is idle.
Returns
Section titled “Returns”frameBudgetMs
Section titled “frameBudgetMs”Get Signature
Section titled “Get Signature”get frameBudgetMs():
number
Defined in: sdk/src/runtime/bakes.ts:159
What this frame may spend: the steady budget, and the extra while something urgent is outstanding.
Returns
Section titled “Returns”number
urgent
Section titled “urgent”Get Signature
Section titled “Get Signature”get urgent():
boolean
Defined in: sdk/src/runtime/bakes.ts:154
Whether something the player would see missing is still being made: what a loading screen waits for.
Returns
Section titled “Returns”boolean
Methods
Section titled “Methods”clear()
Section titled “clear()”clear(
owner):void
Defined in: sdk/src/runtime/bakes.ts:95
Parameters
Section titled “Parameters”object
Returns
Section titled “Returns”void
hasTime()
Section titled “hasTime()”hasTime(
owner?):boolean
Defined in: sdk/src/runtime/bakes.ts:115
Whether owner’s work stepped elsewhere may go on this frame. Such work does what it must at once (what stands right by the
player) whatever this says, and stops when it says no; saying no is remembered, so the jobs leave it more of the next frame.
The first time an owner asks in a frame it is given its part: what the frame has left, divided among it and those that asked the frame before and have not had their turn yet. An owner that asks alone has all of it.
Parameters
Section titled “Parameters”owner?
Section titled “owner?”object = SHARED
Returns
Section titled “Returns”boolean
mark()
Section titled “mark()”mark(
owner,label,progress):void
Defined in: sdk/src/runtime/bakes.ts:90
Shows work that is stepped elsewhere (pages made a few a frame) under label while progress is below 1; owner names it,
so a later mark replaces it. Mark it 1, or clear it, when it is done.
Parameters
Section titled “Parameters”object
string
progress
Section titled “progress”number
Returns
Section titled “Returns”void
run<
T>(label,job):object
Defined in: sdk/src/runtime/bakes.ts:77
Runs job over the frames to come, under label; the promise is what it returns. A job that is cancelled (see cancel)
never settles.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”string
WorkJob<T>
Returns
Section titled “Returns”object
cancel
Section titled “cancel”cancel: () =>
void
Returns
Section titled “Returns”void
done:
Promise<T>
step()
Section titled “step()”step(
now?):void
Defined in: sdk/src/runtime/bakes.ts:164
Starts the frame’s budget and steps the jobs for their part of it, oldest first; a job that finishes or throws settles its promise.
Parameters
Section titled “Parameters”() => number
Returns
Section titled “Returns”void
urge()
Section titled “urge()”urge(
owner,urgent):void
Defined in: sdk/src/runtime/bakes.ts:148
Says whether what owner still has to do would be seen missing by the player: the chunk they stand in, the ground under them.
While any owner says so the frame’s budget is larger by priorityExtraMs. Say false when it is done, or it is held for good.
Parameters
Section titled “Parameters”object
urgent
Section titled “urgent”boolean
Returns
Section titled “Returns”void