Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

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

void onUpdate(ITaskResult* taskResult)
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.

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

void onError(com.amazon.apmf.IError* error)
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.

Parameters

error
com.amazon.apmf.IError* — Required The IError object.
Last modified on October 29, 2026