WASIComponentSubtask class final
Caller-side state for a Component Model subtask.
Constructors
- WASIComponentSubtask({String name = 'subtask', WASIComponentSubtaskState state = WASIComponentSubtaskState.starting, void onCancel(WASIComponentSubtask subtask)?})
-
Creates a subtask in
state.
Properties
- cancellationRequested → bool
-
Whether cancellation has already been requested.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasResult → bool
-
Whether the subtask returned a result value.
no setter
- name → String
-
Debug label used in diagnostics.
no setter
- onCancel ← void Function(WASIComponentSubtask subtask)?
-
Replaces the cancellation callback.
no getter
- resolved → bool
-
Whether the subtask is in a final state.
no setter
- resolveDelivered → bool
-
Whether the final subtask state has been delivered to the caller.
no setter
- result → Object?
-
Result value returned by the callee task.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state → WASIComponentSubtaskState
-
Current subtask state.
no setter
- waitable → WASIComponentWaitable
-
Waitable used for
waitable.joinandSUBTASKevents.final
Methods
-
addCancellationListener(
void callback(WASIComponentSubtask subtask)) → void - Adds a cancellation callback without replacing an existing callback.
-
cancelBeforeReturned(
) → void - Confirms cancellation after the subtask started but before returning.
-
cancelBeforeStarted(
) → void - Confirms cancellation before the subtask started.
-
markReturned(
{Object? result, bool hasResult = false}) → void - Resolves the subtask as returned.
-
markStarted(
) → void - Marks the subtask as started.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited