Package dev.gmitch215.bytebox.binding
Interface Workflow
- All Superinterfaces:
org.teavm.jso.JSObject
public interface Workflow
extends org.teavm.jso.JSObject
A Workflows binding. Declared with
workflow(), named WORKFLOW by default.
A workflow outlives the request that started it and survives a restart, so this binding starts one and asks after it rather than running it.
- Since:
- 1.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordOne entry a batch did not create.static final recordWhatcreateBatchmade.static interfaceOne workflow instance. -
Method Summary
Modifier and TypeMethodDescriptionorg.teavm.jso.core.JSPromise<Workflow.Instance> default Workflow.BatchResultcreateBatch(int count, TSObject params) Startscountinstances that share one input.default Workflow.BatchResultcreateBatch(TSObject options) Starts up to 100 instances in one call, from the options form.default List<Workflow.Instance> createBatch(List<TSObject> instances) Starts up to 100 instances in one call, from the list form Cloudflare deprecates.static TSObjectBuilds one entry of a batch.org.teavm.jso.core.JSPromise<Workflow.Instance> fetchInstance(String id) default Workflow.InstanceLooks up a running or finished instance.org.teavm.jso.core.JSPromise<TSObject> rawCreateBatch(TSObject batch) default Workflow.InstanceStarts an instance, letting Cloudflare pick the id.default Workflow.InstanceStarts an instance with an id of your own, which makes the call idempotent.Methods inherited from interface org.teavm.jso.JSObject
cast
-
Method Details
-
start
Starts an instance, letting Cloudflare pick the id.- Parameters:
params- the workflow's input- Returns:
- the new instance
-
start
Starts an instance with an id of your own, which makes the call idempotent.- Parameters:
id- the instance idparams- the workflow's input- Returns:
- the new instance
-
instance
Looks up a running or finished instance.- Parameters:
id- the instance id- Returns:
- the instance
-
createBatch
Starts up to 100 instances in one call, from the list form Cloudflare deprecates.An id that already exists, or that repeats inside the batch, is skipped without a word. Use
createBatch(TSObject)to hear about those.- Parameters:
instances- oneentry(java.lang.String, dev.gmitch215.bytebox.js.TSObject)per instance- Returns:
- the instances that were created, in order
-
createBatch
Starts up to 100 instances in one call, from the options form.The object is Cloudflare's own:
{count, params, retention}to start that many instances with one input, or{instances: [...]}to give each its own. A bad entry throws before anything is created; an id that already exists is reported inWorkflow.BatchResult.errors()and the rest are created.- Parameters:
options- the options object- Returns:
- what was created and what was not
-
createBatch
Startscountinstances that share one input.- Parameters:
count- how many, from 1 to 100params- the input every instance gets- Returns:
- what was created and what was not
-
entry
Builds one entry of a batch.- Parameters:
id- the instance idparams- the instance's input- Returns:
- an entry for
createBatch(List)or theinstancesof an options object
-
create
-
rawCreateBatch
-
fetchInstance
-