| 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 >>Status Variables: Task and Stream Globals

The TwhWebActionEx component named waDocStreams in the StreamsDM.pas unit sends out status information about tasks and streams.

Usage:

waDocStreams.execute|Streams|Streams: [Active:(~dyn1~) Max:(~dyn2~) Cap:(~dyn3~)]
Task globals - maintained by TwhAsyncObject in whAsync.pas
ActiveTasks - # of asyn actions currently under way (in dedicated or bg thread)

MaxTasks - # maximum number of a concurrent activities performed in the past (since the exe started)

TasksAttempted - how many async activities were started since the exe started

TasksFinished - how many async activities were neither aborted nor exited with exceptions.}

Stream globals - maintained by TwhResponseStream in htStrWWW.pas
activestreams - # of currently active macro expansion streams.

maxstreams - maximum number of nested/stacked streams (the parser recurses into new streams as needed)

gcStreamDepthLimit - CAPACITY that the system will PRE-ALLOCATE for macro expansion stream objects (pre-allocation takes place for the object controlling the stream, not the stream data itself fwiw, and its an execution time-saver. TO CHANGE the capacity limit, change gcStreamDepthLimit when activestreams is zero. gcStreamDepthLimit defaults to 100 and represents THE ONLY limit to concurrent 'disconnected' streams in the system at this time.
Code to send the status variables:
procedure TdmStreams.waDocStreamsExecute(Sender: TObject);
var
  a1,a2:string;
begin
  with pWebApp, TwhWebActionEx(Sender) do begin
    SplitTerms(HtmlParam,'|',a1,a2);
     //Create the macro used in Parameterize
    Macros.Values[Name]:=a2;     
    if isEqual(a1,'Streams') then 
      //syntax: macro to parameterize, paramname, parameters
      Parameterize(Name,'dyn',    
        Format('%d,%d,%d',[activestreams,maxstreams,gcStreamDepthLimit]))
    else
    if isEqual(a1,'Tasks') then
      Parameterize(Name,'dyn',
        Format('%d,%d,%d,%d',[ActiveTasks,MaxTasks,TasksAttempted,TasksFinished]))
    end;
end;


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

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:51:33.
Session 2092805004, 41 pages sent to CCBot/1.0 (+http://www.commoncrawl.org/bot.html) at 38.107.179.226;
Time to produce this page: 16msec.