สตรีมอะซิงก์
Translation status: ภาษาไทย reader-locale proof. Term names and code fences follow the th-TH pack; supporting prose may still be English.
Callable posture for asynchronous stream functions.
Aliases: async_generator
Syntax: ฟังก์ชัน name(…) สตรีมอะซิงก์ → T
Category#
async
Related#
Examples#
radix/corpus/fient/fient.fab (canonical · keyword)#
Callable posture for asynchronous stream functions.
# =============================================================================
# สตรีมอะซิงก์ — Asynchronous stream callable posture
# =============================================================================
#
# What this teaches:
# • Async stream posture: `สตรีมอะซิงก์ → T` yields promised pulls of `T`.
# • Yield with `ให้`; consume the stream with `วน ออก` inside an async body.
#
# Common mistakes:
# • Expecting every backend to lower `สตรีมอะซิงก์` — some fail closed until a
# channel/async-cursor carrier lands.
#
# See also: สตรีม, อะซิงก์, ให้
# =============================================================================
# GRAMMAR:
# callablePosture :← 'สตรีมอะซิงก์'
#
# BACKEND:
# Product path is Rust async-cursor; other backends may fail closed.
ฟังก์ชัน stream() สตรีมอะซิงก์ → จํานวน {
ให้ 1
ให้ 2
}
เริ่มอะซิงก์ {
วน ออก stream() คงที่ n {
บันทึก n
}
}Expected output:
1
2