| Prev | Next
Menu: Products - Portfolio - Services - Download - Order - Company

 
Topic #1.1.1.1.
ASync Part II
   Introduction  
   Overview  
   New Classes  
   TwhAsyncAction  
   OnExecute  
   OnInit  
   OnFinish  
   OnDestroy  
   ExecuteDosCmd  
   Status Variables  
   ASync Download  
*

  

Browsing >>TwhAsyncAction: The WebAction

Which thread is in control when?

Main ThreadBackground Thread 
X  TwhAsyncAction.OnInit
 X TwhAsyncAction.OnExecute
 X TwhAsyncAction.OnFinish
X  TwhAsyncObject.OnSynchronized
Very special case!
X  TwhAsyncAction.OnDestroy
 

  TwhAsyncAction = class(TwhWebActionEx)
  private
    fAsyncState: TAsyncState;
    fSurfersThread: TwhAsyncThread;
    fThreadClass: TwhAsyncThreadClass;
    fSurfersObject: TwhAsyncObject;
    fObjectClass: TwhAsyncObjectClass;
    fThreadOnInit,
    fThreadOnExecute,
    fThreadOnFinish,
    fThreadOnDestroy: TNotifyEvent;
    fJobsPending: ThtListOfObjects;
    fJobsFinished: ThtListOfObjects;
    fTicksExpires,
    fRefreshInterval,
    fResultValue:Integer;
    fBackgroundTasks: ThtBackgroundTaskThread;
  protected
    hcNextStart: integer;
    hcIndex: integer;
    hcList: ThtListOfObjects;
    procedure HouseClean(Sender: TObject);
    procedure DoExecute; override;
  public
    constructor Create(aOwner:TComponent); Override;
    destructor Destroy; override;
    //
    procedure NewThread;  // makes new thread using the 'ThreadClass'
    procedure Aborted;    // abort NewThread
    //
    function FindSession(const Session:string):Boolean;
    function FindResult(const Session:string;var Index:Integer):Boolean;
    procedure UnlistObject(Sender: TObject);
    //
    property SurfersObject: TwhAsyncObject read fSurfersObject write fSurfersObject;
    property SurfersThread: TwhAsyncThread read fSurfersThread write fSurfersThread;
    property BackgroundTasks: ThtBackgroundTaskThread read fBackgroundTasks write fBackgroundTasks;
  published
    property ResultValue: Integer read fResultValue;
    property RefreshInterval: Integer read fRefreshInterval write fRefreshInterval;
    property TicksExpires: Integer read fTicksExpires write fTicksExpires;
    //
    //
    property AsyncState: TAsyncState read fAsyncState write fAsyncState;
    property ThreadClass: TwhAsyncThreadClass read fThreadClass write fThreadClass;
    property ObjectClass: TwhAsyncObjectClass read fObjectClass write fObjectClass;
    //
    property ThreadOnInit: TNotifyEvent read fThreadOnInit write fThreadOnInit;
    property ThreadOnFinish: TNotifyEvent read fThreadOnFinish write fThreadOnFinish;
    property ThreadOnExecute: TNotifyEvent read fThreadOnExecute write fThreadOnExecute;
    property ThreadOnDestroy: TNotifyEvent read fThreadOnDestroy write fThreadOnDestroy;
    end;


 
Path:  www.href.com to; Services to; Tech Talk Archive to; ASync Part II to; TwhAsyncAction

Copyright © 1995-2012 HREF Tools Corp. All Rights Reserved Worldwide.
Running: WebHub-v2.167 compiled with d16_win32 on Microsoft-IIS/7.5,
Local Time: Wed, 23 May 2012 22:21:22.
Session 2092805004, 16 pages sent to CCBot/1.0 (+http://www.commoncrawl.org/bot.html) at 38.107.179.228;
Time to produce this page: 16msec.