Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread TTimer interval
Mon, Sep 4 2023 11:17 AMPermanent Link

Michael Saunders

What Timer interval delay is recommended that waits for a query to complete before continuing with code that needs to know the result of the query  The query in question checks for the presence of a single unique item from  an EDB  table on a separate server machine .  The code is executed from within  a wi-fi intranet environment from client code on tablets  Just wondering about possible system delays her  In testing on my in house setup I find 100ms OK

THanks in advance
Mon, Sep 4 2023 12:05 PMPermanent Link

Raul

Team Elevate Team Elevate

Not sure what your code is doing but it's better to use a completion (and possibly error) event handler to know when the request is actually complete. This will be actual timings.

If you want a timer as a backup of last resort then it can be fairly large since you can cancel it on event callback. when that happens

Raul


<<
Michael Saunders wrote:

What Timer interval delay is recommended that waits for a query to complete before continuing with code that needs to know the result of the query  The query in question checks for the presence of a single unique item from  an EDB  table on a separate server machine .  The code is executed from within  a wi-fi intranet environment from client code on tablets  Just wondering about possible system delays her  In testing on my in house setup I find 100ms OK

THanks in advance
>>
Tue, Sep 5 2023 10:37 AMPermanent Link

erickengelke

Avatar

Michael Saunders wrote:

> What Timer interval delay is recommended that waits for a query to complete
> before continuing with code that needs to know the result of the query  

If you have event completion routines, for both Succes and Failure, then you don't need a timer to be used.  Either the transaction will work, or under any other condition. (including time out) it will go to the failure routine.

I often use a single failure routine for all transactions, with something like:

TFormX.OnError( sender : TOBject );
begin
  show message('URL failed: ' + TServerRequest( sender ).url );
end;

where it gets the URL from the TServerRequest, so you don't need to write separate code for each one.

Erick
EWB Programming Books and Nice Component Library
See my EWB BLOG posts, at:
http://www.erickengelke.com
Image