Closed anzz1 closed 9 months ago
FYI, I implemented this in AzerothCore's fork: https://github.com/azerothcore/mod-eluna/pull/113
Looks good. AsyncQuery exists in all cores we support, but I think it behaves a bit differently in some. So we need to do a bit more lifting to make it work all of the cores.
Async queries are implemented in the multistate branch, it will either be ported to main or available once multistate is merged down.
Currently Eluna has only DBQuery and DBExecute which of Execute is pushed to the core's database worker thread pool and does not block, but also does not return results. If you want to make a database query, it is always synchronous and hence always blocking.
If something like this would be implemented in Eluna Engine
Something like this could be used then in scripts:
Such thing is probably implemented in all the supported cores (?) because doing synchronous queries for everything and blocking execution is not viable. I know that at least AzerothCore and TrinityCore does have this ASyncQuery method DatabaseWorkerPool.cpp#L225 , it just needs to be implemented in Eluna.