kw respond
Reserved keyword
The list of words: §1.4
Syntax
PStep = ( "respond" Expr | Expr ) [ "on" Ident ] [ "durable" | "best_effort" ] ;Primary = Literal | Path | "it" | "self" | "(" Expr { "," Expr } ")" | ListLit | MapLit
| StructLit | Lambda | Block | If | Match | For | While | Loop | Scope | Select | Query
| "spawn" ( Postfix | Block ) | "await" Unary | "atomic" [ "(" Args ")" ] Block
| "return" [ Expr ] | "fail" Expr | "yield" Expr | "respond" Expr | "break" [ Label ] [ Expr ]
| "continue" [ Label ] | "emit" Path "(" Expr ")" | "unsafe" Block | "blocking" Block
| "comptime" Block | "." Ident [ "(" [ Args ] ")" ] ;Grammar: App. A
Defined in
- 10.6 Pipelines — A pipeline is a linear chain of steps, each of which runs on its own node; data is passed from node to node directly, the caller receives on
- 5.8 Other expressions — defer e — executes e on leaving the block (including on fail, return, cancellation), in the reverse order of declaration.
- 1.4 Keywords — Reserved (cannot be used as names)
Examples
pipeline uploadPhoto(img: Image) -> PhotoId {
validate
-> Store.put(it) on storage
-> respond it.id
-> resize(it, THUMB_SIZES) on gpu
-> moderate on ml durable
-> SearchIndex.add(it)
} on_error(e, step) { Dlq.push(e, step) }Related diagnostics
pipeline-idempotency, respond-twice, respond-type, unknown-role