|
Gin
|
Async updater that calls a std::function callback instead of requiring virtual override. More...
#include <gin_asyncutilities.h>
Inherits juce::AsyncUpdater.
Public Member Functions | |
| LambdaAsyncUpdater (std::function< void()> func) | |
Public Attributes | |
| std::function< void()> | onAsyncUpdate |
Async updater that calls a std::function callback instead of requiring virtual override.
LambdaAsyncUpdater provides a more convenient alternative to juce::AsyncUpdater by accepting a lambda or std::function for the async callback. This is useful for safely triggering message-thread operations from other threads without creating a full subclass.
Key Features:
The onAsyncUpdate function is called on the message thread when triggerAsyncUpdate() is called from any thread. Multiple calls are coalesced into a single callback.
Thread Safety:
Usage:
| LambdaAsyncUpdater::LambdaAsyncUpdater | ( | std::function< void()> | func | ) |
| std::function<void()> LambdaAsyncUpdater::onAsyncUpdate |