API reference
GDAsyncContext
Context passing the first cancellation reason and deadline from parent to child.
Properties
reason: ErrA failure value with a category, message, details, causes, and partial result. Err.NOT_FOUND and related names are shared values. join() retains independent failures, and find() searches every cause.
Methods
cancel(msg: String = "canceled", kind: Err = null) -> voidwith_cancel() -> GDAsyncContextwith_timeout(sec: float) -> GDAsyncContextis_done() -> bool
cancel
cancel(msg: String = "canceled", kind: Err = null) -> voidCancel a script context with a shared error category.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
msg | String | "canceled" | Message text associated with this operation. |
kind | Err | null | Error kind used for classification and matching. |
Return value
void
No value is returned.
Errors
This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.
with_cancel
with_cancel() -> GDAsyncContextCreate a child inheriting parent cancellation.
Parameters
No parameters.
Return value
GDAsyncContext
Errors
This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.
with_timeout
with_timeout(sec: float) -> GDAsyncContextCreate a child context with a deadline measured in seconds. Cancelling the parent also cancels the child; the parent itself is not changed.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
sec | float | Required | Duration until cancellation, in seconds. |
Return value
GDAsyncContext
A new child context.
Errors
This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.
See also
is_done
is_done() -> boolReturn whether cancellation or the deadline has completed this context.
Parameters
No parameters.
Return value
bool
Errors
This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.