Mode
A Mode is how a caller invokes a Verb: try waits and stores nothing, send returns a pending Action, do waits for the result.
Properties
| Property | Type | Required | Description |
|---|---|---|---|
name | string | required | One of try, send, or do. |
durable | boolean | required | True when the Action is stored and survives restarts: send and do. |
waits | boolean | required | True when the caller holds the call open until the result: try and do. |
holdSeconds | integer | For do: seconds a call holds before it returns 202 with the pending Action; Setting mode.holdSeconds. | |
maxWaitSeconds | integer | The longest hold Prefer: may ask for; Setting mode.maxWaitSeconds. |
Object
{
"$id": "https: //api.sb/ ledgerlark.com/ modes/ mode_1",
"$type": "Mode",
"name": "try",
"durable": true,
"waits": true,
"holdSeconds": 60,
"maxWaitSeconds": 300
}Relationships
- A Mode default for many Verbs: the Mode a call uses when the caller names none:
try,sendordo.defaultFor, inversedefaultsTo. - A Mode is a mode of many Actions: the Mode the caller chose:
trystores nothing,sendreturns a pending Action,dowaits for the result.modeOf, inverserunsIn.
Verbs
getReturns one Mode by id.GET /{namespace}/modes/{id}listReturns Modes, newest first, one page at a time.GET /{namespace}/modes
A Mode is kept forever and never edited: it has no update or delete.
Permissions
Which Access level may call each Verb. One-way Verbs wait their delay window.
| Operation | owner | admin | member | viewer |
|---|---|---|---|---|
Mode.get | Yes | Yes | Yes | Yes |
Mode.list | Yes | Yes | Yes | Yes |
Call it
Show me the latest mode.Example
import { $ } from 'startup-builder'
const preview = await $.try.Order.place({ offer: 'offer_1' }) // waits, stores nothing
const pending = await $.send.Order.place({ offer: 'offer_1' }) // the Action, status Pending
const order = await $.do.Order.place({ offer: 'offer_1' }) // waits for the finished Action