FastLED 3.9.15
Loading...
Searching...
No Matches

◆ reject()

template<typename T>
bool fl::task::detail::PromiseImpl< T >::reject ( const Error & error)
inline

Reject Promise with error.

Definition at line 307 of file promise.h.

307 {
308 if (state() != PromiseState_t::PENDING) return false;
309
310 mError = error;
312
315 }
316
317 return true;
318 }
const Error & error() const FL_NOEXCEPT
Get error (only valid if rejected)
Definition promise.h:341
fl::function< void(const Error &)> mCatchCallback
Definition promise.h:351
void process_callbacks() FL_NOEXCEPT
Process pending callbacks.
Definition promise.h:366
void set_state(PromiseState_t s) FL_NOEXCEPT
Write the state atomically.
Definition promise.h:361
PromiseState_t state() const FL_NOEXCEPT
Read the state atomically.
Definition promise.h:356
Implementation class for Promise - holds the actual state and logic.
Definition promise.h:245

References error(), FL_NOEXCEPT, mCallbacksProcessed, mCatchCallback, mError, fl::task::detail::PENDING, process_callbacks(), fl::task::detail::REJECTED, set_state(), and state().

+ Here is the call graph for this function: