receive

Group: concurrency

Receives a message.

Syntax

    (0)     receive result:r-op|void :timeout

    -- wait for 1 second
    (1)     receive %1 local 1s

    -- wait for 1 millisecond
    (2)     receive %1 local 1ms

    -- wait forevery
    (3)     receive  %1 local infinity
            print %1 local
    

Examples

.function: example/0
    -- wait for a message
    receive %1 local infinity

    -- print received message
    print %1 local

    return
.end
    

Related instructions

send.