Skip to content

await

Concurrency

Wait for a Promise-like value inside an async function.

T x = await expr;
NameTypeDescription
expranyPromise (:expect()) or already-resolved value.

The resolved value.

__await(expr)

Not JS await in the event loop sense beyond what Luau Promises provide. Use spawn to run a block without blocking the caller.

Data data = await DataService.Server.WaitFor(player);

Emits:

local data: Data = __await(DataService.Server:WaitFor(player))

async · spawn · pcall