API / CLASS REFERENCE
UltralightTask
Inherits: RefCounted
Single-completion asynchronous operation with a retained result.
Check is_completed before awaiting completed because an operation may finish synchronously. Read get_result afterwards; the result remains available. Only the first terminal operation takes effect. Cancel stops this observation or delivery without undoing business side effects or forcibly terminating a JavaScript Promise. Public resolve/reject are used by register_async handlers.
Methods
is_completed() → bool constget_result() → UltralightResult constresolve(value: Variant = null) → voidreject(code: String, message: String) → voidcancel() → void
is_completed
is_completed() → bool constReturn whether a terminal result is retained.
get_result
get_result() → UltralightResult constReturn the retained result, or null before completion.
resolve
resolve(value: Variant = null) → voidComplete a host async request successfully. Repeated completion is ignored. Main thread only.
reject
Complete a host async request with the provided error code and message. Main thread only.
cancel
cancel() → voidComplete with Cancelled if still pending. Does not undo already executed operations. Main thread only.
Signals
completed
completed()Emitted once when the task reaches its terminal state. Check is_completed before awaiting, then call get_result.