kw send
Contextual keyword — select branches (§8.7)
The list of words: §1.4
Syntax
SelArm = ( "recv" Pattern "from" Expr | "send" Expr "to" Expr | "after" Expr | "else" ) "=>" Expr ;Grammar: App. A
Defined in
- 8.7 Channels and select — tx.send(x) suspends when the buffer is full; cap
- 1.4 Keywords — Reserved (cannot be used as names)
- 4.3 Construction and constructors — Literal. T{ f1: e1, f2, ..base }
Examples
let (tx, rx) = chan<Job>(cap: JOB_QUEUE)
select {
recv job from rx => process(job)
send r to results => sent += 1
after IDLE_TIMEOUT => log.info("idle")
else => tick() // non-blocking variant
}Related diagnostics
bad-init, missing-field, must-close, positional-literal, sealed-literal