Renderingen-US

await

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

Awaits a promise and discards the success value.

Aliases: await

Syntax: await future

Category#

async

Examples#

radix/corpus/tacebit/tacebit.fab (canonical · keyword)#

Awaits a promise and discards the success value.

# =============================================================================
# await — Await-discard
# =============================================================================
#
# What this teaches:
#   • Await any success type `T` and discard the resolved value.
#   • Prefer when side effects matter and the success payload is unused.
#
# See also: await_const, return_await, async, promise
# =============================================================================

# GRAMMAR:
#   awaitDiscard :← 'await' expr

fn responde() async → int {
    return 1
}

async_main {
    await responde()
    print "done"
}

Expected output:

done