渲染zh-Hant

meus

Translation status: 繁體中文 reader-locale proof. Code fences render through the zh-Hant pipeline; prose is canonical Latin.

live outbound and inbound sermo directional views

Syntax:

Category#

endpoint

Examples#

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

live outbound and inbound sermo directional views

# =============================================================================
# meus — live outbound and inbound sermo directional views.
# =============================================================================
#
# What this teaches:
#   • Directional sermo views — `meus<T>` for outbound frames, `tuus<T>` for
#     inbound frames on a sermo connection
#   • Cursor iteration — `itera ex t.cursor()` consumes inbound frames
#   • Accipe reception — `accipe()` pulls a single scrinium from the inbound
#     queue
#
# Common mistakes:
#   • confusing `meus` (outbound) and `tuus` (inbound) sermo directional views, or mixing accipe/cursor/exhauri without intentional ordered consumption
#
# See also: ad, sermo, tuus, scrinium, cursor, accipe
# =============================================================================

# Live `meus<T>` / `tuus<T>` directional views
#
# runtime:echo returns one inbound textus frame per conversation.
# accipe, cursor, and exhauri may share one tuus queue; mix them only when
# ordered consumption is intentional.

main {
    const sermo s  call 'runtime:echo' ("salve")

    const meus<string> m  s.meus<string>()
    m.da("ping")
    const status outbound  m.fini()

    const tuus<string> t  s.tuus<string>()
    for from t.cursor() const frame {
        assert frame.data  "salve"
    }
    const status inbound  t.fini()

    const sermo s2  call 'runtime:echo' ("salve")
    const tuus<string> t2  s2.tuus<string>()
    const scrinium<string>  null got  t2.accipe()
    const status accipe_done  t2.fini()

    print outbound
    print inbound
    print got
    print accipe_done
}