Solved

Using HTTPRIO like Ajax

Posted on 2006-11-02
1
709 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month8 days, 8 hours left to enroll

617 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