SplitScript reference / Language / await

await

keyword

let value = await operation

Waits for an asynchronous value and yields its result.

await is an ordinary prefix expression available in onAttach and source-defined async helpers. It accepts any async T expression, yields T, and can be nested in calls, operators, member access, conditionals, matches, fallbacks, and loop conditions. Source future values may be stored and awaited repeatedly; an already completed future yields its retained result without rerunning its body. The process-lifetime continuation tree is cancelled when the attached process closes.

Examples

Wait during attachment

let module = await process.module("GameAssembly.dll")