WaitHeader

The Wow-Wait and Wow-Wait-Timeout headers.

plan := hop (">" hop)*
hop := "accepted" ["(" ctx ")"]
| "committed" ["(" ctx ")"]
| "snapshot" ["(" ctx ")"]
| "queryable" ["(" ctx ")"]
| "handled(" [ctx "/"] subscription ")"

Keywords are case-insensitive and white space around the tokens is ignored: handled(order/payment-saga) > committed(inventory). A subscription is named as in the Manifest and may hold dots (processor.function), so the context of a handled hop is set apart by /. handled(wow.snapshot) is the same hop as snapshot, and handled(wow.queryable) as queryable: the commit is in the store the aggregate type's snapshot queries read. The timeout is <n>ms, <n>s, <n>m with no space between the number and its unit, or an ISO-8601 duration (PT10S), and one millisecond or more.

format prints a plan as parse reads it, the inverse of parse.

A plan is read in time linear in its length, by hand rather than by a pattern whose quantifiers could share white space and backtrack over it (#6815), and is refused before any hop is read when it is longer than MAX_LENGTH characters or has more than MAX_HOPS hops: a request's header bounds the work admission does for it.

Properties

Link copied to clipboard
const val MAX_HOPS: Int = 32

The most hops parse reads, the most any node's wait follows (its wow.wait.max-hops is at most this).

Link copied to clipboard
const val MAX_LENGTH: Int = 4096

The longest plan parse reads: 32 hops of 128 characters.

Functions

Link copied to clipboard
fun format(plan: WaitPlan): String

plan's hops as parse reads them.

Link copied to clipboard
fun formatHop(hop: Hop): String

hop as parseHop reads it.

Link copied to clipboard

timeout as parseTimeout reads it.

Link copied to clipboard
fun parse(value: String): WaitPlan

The plan value spells.

Link copied to clipboard
fun parseHop(value: String): Hop

The hop value spells: a keyword of ASCII letters, then, after optional white space, an argument in parentheses that holds none, white space around it ignored.

Link copied to clipboard

The timeout value spells.