Interface ITaskObserver
interface ITaskObserver
Extends com.amazon.apmf.IStandard
The ITaskObserver allows callers to get notified of updates in Task execution.
It can signal intermediate results, final results as well as errors returned by the Task handler
and errors in execution of the Task. Task Observers offer the convenience to react to a Task
Result immediately. However, they are not a substitute for persisting results in use cases where
the result must be consumed by another part of the app that may not be running at that instant.
Note that ITaskObserver callbacks may execute on a thread which may be different from the main
thread of the app.
Methods
onUpdate()
A callback to be called when Task results are ready. The results could indicate an intermediate result, success or task failure. The callbacks are not retried if an exception is thrown.voidonUpdate(ITaskResult*taskResult)
Parameters
taskResult
ITaskResult* — Required
the Task Result submitted by the app.
Note that the call may occur on a different thread than the one on which the observer was
registered. It may also be called on a different thread each time.
onError()
Method called to signal an error in task execution. Errors indicate an app crash. The callbacks are not retried if an exception is thrown. Note that no further updates will be sent to the observer.voidonError(com.amazon.apmf.IError*error)
Parameters
error
com.amazon.apmf.IError* — Required
The IError object.

