Renderingen-US

Experimental through version 1. Version 0 was alpha. This is the first language release: the interface is relatively stable, not frozen. Nothing is promised stable until version 2.

recv

Translation status: English reader-locale proof. Term names and code fences follow the en pack; supporting prose may still be English.

typed inbound channel stream view

Syntax:

Category#

endpoint

Examples#

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

typed inbound channel stream view

# =============================================================================
# recv — typed inbound channel stream view.
# =============================================================================
#
# What this teaches:
#   • Typed inbound stream — `s.recv<T>()` (la `s.tuus`) creates a typed
#     view over the incoming frames of a channel connection
#   • Cursor consumption — cursor() yields frames that can be iterated with
#     `for from`
#
# Common mistakes:
#   • confusing call route syntax — accessing the `recv<T>` stream after `finish()` has been called leaves no usable data
#
# See also: call, channel, frame, cursor
# =============================================================================

# s.recv<T>() — typed inbound frame stream (la s.tuus)

main {
    let channel s ← call 'runtime:echo' ("salve")
    for from s.recv<string>().cursor() let frame {
        assert frame.data ≡ "salve"
    }
}