class fwt::AsyncTask
sys::Obj fwt::AsyncTask
@Js
AsyncTask models an asynchronous operation's progress and provides a list of callback handlers when the task completes (either successfully or fails).
- isDone
-
Bool isDone()
True if
markDone
has been invoked. - isErr
-
Bool isErr()
True if
markErr
has been invoked. - isPending
-
Bool isPending()
- isRO
-
Bool isRO()
Is this instance read-only. Read-only tasks may not be marked as done or err.
- markDone
-
Void markDone(Obj? obj := null)
Mark this Task as
done
and invoke all itsonDone
callbacks with given argment. - markErr
-
Void markErr(Obj? obj := null)
Mark this Task as
erred
and invoke all itsonErr
callbacks with given argment. - onDone
-
This onDone(|Obj?| doneCallback)
Add a callback to be invoked when this task completes successfully.
- onDoneOrErr
-
This onDoneOrErr(|Obj?| doneOrErrCallback)
Add a callback that will always be invoked, regardless if task completes successfully or fails.
- onErr
-
This onErr(|Obj?| errCallback)
Add a callback to be invoked when this task fails.
- ro
-
AsyncTask ro()
Return a new read-only wrapper for this task. Read-only tasks may not be marked as done or err.
- then