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
markDonehas been invoked. - isErr
-
Bool isErr()True if
markErrhas 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
doneand invoke all itsonDonecallbacks with given argment. - markErr
-
Void markErr(Obj? obj := null)Mark this Task as
erredand invoke all itsonErrcallbacks 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