Package dev.gmitch215.bytebox.workflow
Interface Step
- All Superinterfaces:
org.teavm.jso.JSObject
public interface Step
extends org.teavm.jso.JSObject
The durable steps of a Workflow, which is the
step argument of run.
Each call blocks the instance's fiber until the platform has the step's result. A step the platform has already finished returns its saved result and its body does not run, which is what makes a replay cheap. A body that throws fails the attempt, and the platform retries it according to the config.
- Since:
- 1.0.3
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceThe callback the platform calls for a step. -
Method Summary
Modifier and TypeMethodDescriptionorg.teavm.jso.core.JSPromise<org.teavm.jso.JSObject> org.teavm.jso.core.JSPromise<TSObject> org.teavm.jso.core.JSPromise<TSObject> default TSObjectRuns a body as a durable step with retries and a timeout.default TSObjectRuns a body as a durable step.default voidSleeps without holding the instance.Methods inherited from interface org.teavm.jso.JSObject
cast
-
Method Details
-
run
Runs a body as a durable step.The body runs on its own fiber, so it may call any binding. What it returns is stored, so it has to be a structured-cloneable value of at most 1 MiB.
- Parameters:
name- the step's name; use the same one on every replay, at most 256 charactersbody- the work- Returns:
- what the body returned
-
run
Runs a body as a durable step with retries and a timeout.- Parameters:
name- the step's nameconfig- Cloudflare's step config, such as{"retries": {"limit": 3, "delay": "5 seconds"}, "timeout": "1 minute"}body- the work- Returns:
- what the body returned
-
sleep
Sleeps without holding the instance.- Parameters:
name- the step's nameduration- a duration the platform reads, such as"30 seconds"or"1 day"
-
doStep
-
doStep
-
doSleep
-