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;