API Reference › Promise
namespace

Promise

Combine several Job futures and resolve the group on the main thread. Promise.all succeeds once every member has, Promise.race once the first does; both return an ordinary job handle you poll like any other. For a loading screen, Promise.count_done over the same handles is the bar's numerator and len the denominator, and Promise.all_done is the ready check. Ludic has no closures, so progress is polled rather than chained through a then callback. Build the handle list with new []int + push. Spliced in only when a program mentions Promise.*.

Promise.all(handles) -> JobSucceeds when every member succeeds.Promise.race(handles) -> JobSucceeds when the first member does.Promise.count_done(handles) -> intHow many members have resolved.Promise.all_done(handles) -> boolHave all members resolved?
← All symbols