AI Object
 
Syntax
 
lValue = AI.TimeoutSeconds
AI.TimeoutSeconds = lSeconds
 
Type
Long
Access
read/write
Description
Gets or sets the maximum number of seconds the AI object will wait for a single HTTP request to TradiumServices to complete. This timeout applies to the submit call (Ask), to each status poll (GetStatus), and to the connect call. The default value is 30 seconds.
 
Increase this value for hosts on a slow or high-latency connection. Decrease it when the host needs to remain responsive and prefers to fail fast on a network problem rather than block.
TimeoutSeconds bounds individual HTTP transactions, NOT the total time it takes for an AI answer to come back. Long-running AI jobs are handled asynchronously through an AI queue: the submit returns immediately, and GetStatus polls until the job reaches aiStatusReady or aiStatusError. A polling loop can therefore safely run much longer than TimeoutSeconds.
 
See Also
Example
 
Sub Main
Dim hConv As Long
 
AI.TimeoutSeconds = 60 'allow slower connections
hConv = AI.Ask("How many backorders are open?", aiGeneral)
 
Do
DoEvents
Loop Until AI.GetStatus(hConv) <> aiStatusBusy
 
Debug.Print AI.GetResultStr(hConv)
AI.CloseHandle hConv
End Sub