Object that encapsulates a value or an outlook of there might possibly be a value.
Essentially an object that can be assigned a callback.
Promise.fromCallback (f, ...)
Creates a promise that represents result from a function that utilizes a callback.
The function has to expect its callback as a last parameters after all of the parameters that have been used to call this function.
Function that returns its result through a callback. The regular return values are ignored.
List of parameters to
f without the last one.
A promise representing the result of
f that is given to its callback.
local p = Promise.fromCallback(f, a,b,c,d) p:Then(doSomething) -- schedule the actual callback
Creates a promise.
The created promise.
An already fulfilled, but empty promise.
Chains current promise to another one.
Marks promise as fulfilled and fills it with values.
Each promise can be fulfilled only once.
values that should be stored in the promise
Schedules a callback that should be executed once the promise gets fullfilled.
The callback may be executed synchronously if the promise is already fulfilled.
Can also be invoked as a call to the promise, as in instead of
p:Then(f), you may use
The callback will be called with the value of the promise.