Acknowledged
CIQQA-3311

Proposal: Watchdog Budget Indicator and Built-in Task Queue Support in SDK

I'm developing an app that processes large JSON data structures and uses them to instantiate and update a complex CustomMenu hierarchy. During this process, I frequently encounter Watchdog limits.

To mitigate this, I’ve implemented an asynchronous task queue that introduces breaks between tasks to allow other operations to proceed. In fact, when the UI is active, I enforce an execution time limit stricter than the Watchdog's to ensure responsiveness. So, I do think the Watchdog mechanism is useful and important.

However, I believe the SDK could offer better tooling to help developers work within these constraints:

  1. Watchdog Budget Indicator
    A simple yet powerful improvement would be to extend Toybox.System.Stats with a property indicating how much of the current Watchdog budget remains. This would allow developers to more safely optimize task batching and avoid unintentional overuse.

  2. Built-in Task Queue Framework
    A native task queue implementation in the SDK could greatly simplify cooperative multitasking. For example, developers could define tasks via a standard interface or base class, and the SDK could handle scheduling. Ideally, the execution batch size could be configurable—by time, task count, or even remaining Watchdog budget (e.g., "pause after 80% budget used").

Even though the task queue can be implemented manually, having an official, supported implementation would simplify development and encourage consistent, reliable handling of long-running processes.