Here is a Web app that provides realtime processing and monitoring of data. The idea is for a changing series of data locations to be scanned and any data found sucked up, processed sorted and made available as one orderly queue.
I have a Container with a button action which calls a looping WebThread subclass (sleep set to 700ms) to monitor a property in a data acquisition and processing class. The looping WebThread changes a style in a Rectangle in the Container, so I know this works fine because it blinks - yellow when data is received, alternating between green and grey when the data class is checked but no data was ready. So far, so good...
FYI: The data processing class being monitored is instantiated first by the button action via another launching class which appends the data processing class to a dictionary, returning a reference to the button action that is assigned to a variant. The variant is then assigned to a property of of the Container to increase the monitored class's scope beyond the button action event. After this the previously-mentioned looping WebThread subclass is then instantiated and also assigned to a property of the Container, and a Handler is added which includes a WebSessionContext for good measure.
The monitored data processing/acquisition class itself has three threads. The first checks an array of file locations to see if there is any data and if so, fetches the data and adds it to a dictionary. Critical sections control this operation on the Dictionary. Another thread processes any data in the dictionary, removes it and adds processed output to an array used as a stack, which processing is also all controlled by critical sections. Another thread controls the array of file locations which is also critically sectioned. The stack array of the data processing/acquisition class is monitored by the looping WebThread class for a Count (ubound+1) of > -0. If the count is greater the top item is output to a WebListbox in the WebContainer. A "RemoveTop Item" method is then called in the monitored class until the count reaches zero. All the threads have sleeps to allow the others to run.
Now here's the thing: When the button action is pressed the monitoring starts and the first found file data is picked up, processed and presented in the WebListBox no problem. But none after that. However, if I put a break in either the input or processing threads of the data acquisition/processing class, subsequent updates to the WebList box work fine. Take away the Break and there's nothing more. Seems my code's logic is good but it naughtily only works after the first time if it's being watched !