Core/DBLayer: Implement async transaction completion callbacks

Port From (https://github.com/TrinityCore/TrinityCore/commit/0f0ca3a9194d76afa0227943e86469ad8368c5e2)
This commit is contained in:
hondacrx
2020-04-26 00:53:43 -04:00
parent a9d1d3f2b0
commit d450f6db3d
14 changed files with 224 additions and 109 deletions
+3 -3
View File
@@ -1781,7 +1781,7 @@ namespace Game
{
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHARACTER_COUNT);
stmt.AddValue(0, accountId);
_queryProcessor.AddQuery(DB.Characters.AsyncQuery(stmt).WithCallback(_UpdateRealmCharCount));
_queryProcessor.AddCallback(DB.Characters.AsyncQuery(stmt).WithCallback(_UpdateRealmCharCount));
}
void _UpdateRealmCharCount(SQLResult result)
@@ -2145,7 +2145,7 @@ namespace Game
void ProcessQueryCallbacks()
{
_queryProcessor.ProcessReadyQueries();
_queryProcessor.ProcessReadyCallbacks();
}
public void ReloadRBAC()
@@ -2324,7 +2324,7 @@ namespace Game
ConcurrentQueue<Tuple<WorldSocket, ulong>> _linkSocketQueue = new ConcurrentQueue<Tuple<WorldSocket, ulong>>();
QueryCallbackProcessor _queryProcessor = new QueryCallbackProcessor();
AsyncCallbackProcessor<QueryCallback> _queryProcessor = new AsyncCallbackProcessor<QueryCallback>();
Realm _realm;