class fwt::AsyncTask

sys::Obj
  fwt::AsyncTask

@Js

Source

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()

Source

True if markDone has been invoked.

isErr

Bool isErr()

Source

True if markErr has been invoked.

isPending

Bool isPending()

Source

True until markDone or markErr invoked.

isRO

Bool isRO()

Source

Is this instance read-only. Read-only tasks may not be marked as done or err.

markDone

Void markDone(Obj? obj := null)

Source

Mark this Task as done and invoke all its onDone callbacks with given argment.

markErr

Void markErr(Obj? obj := null)

Source

Mark this Task as erred and invoke all its onErr callbacks with given argment.

onDone

This onDone(|Obj?| doneCallback)

Source

Add a callback to be invoked when this task completes successfully.

onDoneOrErr

This onDoneOrErr(|Obj?| doneOrErrCallback)

Source

Add a callback that will always be invoked, regardless if task completes successfully or fails.

onErr

This onErr(|Obj?| errCallback)

Source

Add a callback to be invoked when this task fails.

ro

AsyncTask ro()

Source

Return a new read-only wrapper for this task. Read-only tasks may not be marked as done or err.

then

This then(|Obj?| doneCallback, |Obj?|? errCallback := null)

Source

Convenience for onDone and onErr together.