Downtown Chronicles
LibraryModulesCallbacks

Await

async cross-side callback (returns a promise).

lib.callbacks.await(name, ...)

Same argument rules as get, but returns a promise (no Citizen.Await on your side). Resolves to a table of return values.

Server → client: pass source first, then payload.

lib.callbacks.await('slowJob', source, jobId):next(function(results)
    local a, b = table.unpack(results)
end)

Client → server: pass payload only (no source).

lib.callbacks.await('slowJob', jobId):next(function(results)
    local a, b = table.unpack(results)
end)

See also: get · register