gửi
Translation status: Tiếng Việt reader-locale proof. Term names and code fences follow the vi pack; supporting prose may still be English.
live outbound and inbound kênh directional views
Syntax:
Category#
endpoint
Related#
Examples#
radix/corpus/ad/sermo-live-directional.fab (canonical · method)#
live outbound and inbound kênh directional views
# =============================================================================
# gửi — live outbound and inbound kênh directional views.
# =============================================================================
#
# What this teaches:
# • Directional kênh views — `gửi<T>` for outbound frames, `nhận<T>` for
# inbound frames on a kênh connection
# • Cursor iteration — `lặp từ t.cursor()` consumes inbound frames
# • Accipe reception — `accipe()` pulls a single khung from the inbound
# hàng_đợi
#
# Common mistakes:
# • confusing `gửi` (outbound) and `nhận` (inbound) kênh directional views, or mixing accipe/cursor/exhauri without intentional ordered consumption
#
# See also: gọi, kênh, nhận, khung, con_trỏ, accipe
# =============================================================================
# Live `gửi<T>` / `nhận<T>` directional views
#
# runtime:echo returns one inbound văn_bản frame per conversation.
# accipe, con_trỏ, and exhauri may share one nhận hàng_đợi; mix them only when
# ordered consumption is intentional.
main {
const kênh s ← call 'runtime:echo' ("salve")
const gửi<string> m ← s.meus<string>()
m.da("ping")
const status outbound ← m.fini()
const nhận<string> t ← s.tuus<string>()
for from t.cursor() const frame {
assert frame.data ≡ "salve"
}
const status inbound ← t.fini()
const kênh s2 ← call 'runtime:echo' ("salve")
const nhận<string> t2 ← s2.tuus<string>()
const khung<string> ∪ none got ← t2.accipe()
const status accipe_done ← t2.fini()
print outbound
print inbound
print got
print accipe_done
}