渲染zh-Hant

接收

Translation status: 繁體中文 reader-locale proof. Term names and code fences follow the zh-Hant pack; supporting prose may still be English.

typed inbound 通道 stream view

Syntax:

Category#

endpoint

Examples#

radix/corpus/ad/sermo-tuus.fab (canonical · method)#

typed inbound 通道 stream view

# =============================================================================
# 接收 — typed inbound 通道 stream view.
# =============================================================================
#
# What this teaches:
#   • Typed inbound stream — `s.tuus<T>()` creates a typed view over the
#     incoming frames of a 通道 connection
#   • Cursor consumption — 迭代器() yields frames that can be iterated with
#     `遍歷 取自`
#
# Common mistakes:
#   • confusing 端點 route syntax — accessing `接收<T>` stream after `fini()` has been called leaves no usable data
#
# See also: 端點, 通道, 幀, 迭代器
# =============================================================================

# sermo.tuus<T>() — typed inbound frame stream

main {
    const 通道 s ← call 'runtime:echo' ("salve")
    for from s.tuus<string>().cursor() const frame {
        assert frame.data ≡ "salve"
    }
}

Expected output: