8/11/23 - Cambios en DBRequestManager

This commit is contained in:
2023-11-08 13:55:27 -06:00
parent ed1e2b5a34
commit 326c0e7d7b
3 changed files with 18 additions and 7 deletions

View File

@@ -16,6 +16,7 @@ Sub Class_Globals
Private VERSION As Float = 0.9
Private tempArray(1) As Object
Dim jobTagAnterior As String = "" 'Mod por CHV - 211109
Dim reqsList As List
End Sub
'Target - The module that handles JobDone (usually Me).
@@ -23,6 +24,7 @@ End Sub
Public Sub Initialize (Target As Object, ConnectorLink As String)
mTarget = Target
link = ConnectorLink
reqsList.Initialize
End Sub
'Sends a query request.
@@ -33,7 +35,8 @@ Public Sub ExecuteQuery(Command As DBCommand, Limit As Int, Tag As Object)
Dim j As HttpJob
Dim ms As OutputStream
Dim out2 As OutputStream = StartJob(j,ms, Tag)
If reqsList.IsInitialized Then reqsList.Add(Tag)
WriteObject(Command.Name, out2)
WriteInt(Limit, out2)
WriteList(Command.Parameters, out2)
@@ -59,6 +62,7 @@ End Sub
'Similar to ExecuteBatch. Sends a single command.
Public Sub ExecuteCommand(Command As DBCommand, Tag As Object)
If reqsList.IsInitialized Then reqsList.Add(Tag)
ExecuteBatch(Array As DBCommand(Command), Tag)
End Sub
@@ -113,7 +117,7 @@ Private Sub WriteObject(o As Object, out As OutputStream)
Else If GetType(tempArray(0)) = "[B" Then
data = o
out.WriteBytes(Array As Byte(T_BLOB), 0, 1)
WriteInt(data.Length, out)
WriteInt(data.Length, out)
Else 'If o Is String Then (treat all other values as string)
out.WriteBytes(Array As Byte(T_STRING), 0, 1)
data = bc.StringToBytes(o, "UTF8")