Solved

Using HTTPRIO like Ajax

Posted on 2006-11-02
1
707 Views
Last Modified: 2007-12-19
Hi,

I have,

procedure DoSomething;
var
    HTTPRIO: THTTPRIO;
    Res : TMyClass; // TRemotable
begin
   HTTPRIO := THTTPRIO.Create(AOwner);
   Res := (HTTPRIO as MyWebService).CallSomething;
   // Use Res
end;

1. Now when I call DoSomething the execution will not proceed until the DoSomething has finished. However, I wish it should proceed without waiting for DoSomething to finish.

2. Sometime it will also require to wait until DoSomething has finished.

I understand that this can be accomplished by using Threads. Can someone give me some example / working code for this?

My goal is to improve existing performance, can this approach be helpful? is there any risk with this approch?

Thanks.
0
Comment
Question by:atul_parmar
1 Comment
 
LVL 27

Accepted Solution

by:
BigRat earned 500 total points
ID: 17858140
In actual fact the Windows Socket interface is asynchronous, so one technically does not need threads. If you're interested check out the ICS Suite from Francois Piette (at Torry). But it's usage is not simple, although quite powerful.

The thread approach involves creating a class derived from TThread and overriding the procedure Execute. You simply put your app code in there.

You then create an instance of the thread (normally suspended) set any variables and then call Resume
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question