Enhanced QtConcurrent based on AsyncFuture
Installation
qpm install net.efever.aconcurrent
API
#include <aconcurrent.h>
QFuture AConcurrent::runOnMainThread(Functor functor)
Run a function on main thread. If the current thread is main thread, it will be executed in next tick.
QFuture AConcurrent::mapped(Sequence sequence, Functor worker)
- An implementation of mapped() that support lambda function
- It is cancelable
QFuture AConcurrent::blockingMapped(Sequence sequence, Functor worker)
void AConcurrent::debounce(context, key, future, functor)
AConcurrent::await(future)
Wait until the input future is finished while keeping the event loop running.