192 if (await_depth.
access() > 10) {
193 return fl::result<T>(
Error(
"await_top_level recursion limit exceeded - possible infinite loop"));
200 const int max_pump_iterations = 10000;
220 if (pump_count >= max_pump_iterations) {
size_t total_active_tasks() const
Get total number of active tasks across all runners.
bool has_active_tasks() const
Check if there are any active async tasks.
static AsyncManager & instance()
void update_all()
Update all registered async runners.
void register_runner(async_runner *runner)
Register an async runner.
fl::vector< async_runner * > mRunners
void unregister_runner(async_runner *runner)
Unregister an async runner.
Async task manager (singleton)
static Scheduler & instance()
void update_before_frame_tasks()
void warn_no_catch(int task_id, const fl::string &trace_label, const Error &error)
void update_after_frame_tasks()
fl::vector< task > mTasks
void warn_no_then(int task_id, const fl::string &trace_label)
void update_tasks_of_type(TaskType task_type)
virtual ~async_runner()=default
virtual bool has_active_tasks() const =0
Check if this runner has active tasks.
virtual size_t active_task_count() const =0
Get number of active tasks (for debugging/monitoring)
virtual void update()=0
Update this async runner (called during async pumping)
Generic asynchronous task runner interface.
const Error & error() const
Get the error (only valid if is_rejected() returns true)
void update()
Update promise state in main loop - should be called periodically This processes pending callbacks wh...
bool is_resolved() const
Check if promise is resolved (completed successfully)
bool valid() const
Check if promise is valid.
const T & value() const
Get the result value (only valid if is_resolved() returns true)
bool is_completed() const
Check if promise is completed (resolved or rejected)
Promise class that provides fluent .then() and .catch_() semantics This is a lightweight wrapper arou...
Result type for promise operations.
Universal timing functions for FastLED.
Implements the FastLED namespace macros.
fl::result< T > await_top_level(fl::promise< T > promise)
Synchronously wait for a promise to complete (ONLY safe in top-level contexts)
void async_yield()
Platform-specific async yield function.
size_t async_active_tasks()
Get the number of active async tasks across all systems.
ThreadLocalFake< T > ThreadLocal
void async_run()
Run all registered async tasks once.
HeapVector< T, Allocator > vector
bool async_has_tasks()
Check if any async systems have active tasks.
Promise-based fluent API for FastLED - standalone async primitives.
Result type for promise operations with ok() semantics.