Run a generator-based workflow against a Restate context.
op is an Operation<T> — typically the result of
gen(function*() { ... }). Inside the generator body, reach for the
free-standing API (run, sleep, all, state, …) imported
from @restatedev/restate-sdk-gen. They read the active scheduler from a
synchronous current-fiber slot installed by Fiber.advance.
gen() already takes a factory, so the same Operation is re-
iterable across multiple execute() calls — no need for a builder
lambda at this boundary.
By default execute resolves as soon as the main operation settles;
spawned fibers (and race losers) still running at that point are
abandoned. Pass { onMainExit: "join" } to instead keep driving
until every spawned fiber has finished.
Run a generator-based workflow against a Restate context.
opis anOperation<T>— typically the result ofgen(function*() { ... }). Inside the generator body, reach for the free-standing API (run,sleep,all,state, …) imported from@restatedev/restate-sdk-gen. They read the active scheduler from a synchronous current-fiber slot installed byFiber.advance.gen()already takes a factory, so the sameOperationis re- iterable across multipleexecute()calls — no need for a builder lambda at this boundary.By default
executeresolves as soon as the main operation settles; spawned fibers (and race losers) still running at that point are abandoned. Pass{ onMainExit: "join" }to instead keep driving until every spawned fiber has finished.