I am just getting familiar with using OmniThread and I have been trying to figure out how to get feedback from a Parallel.Pipeline to the main UI thread to update an activity indicator or progress bar. I understand how to use TOmniEventMonitor when using the CreateTask API call. But as I look at a Parallel.Pipeline command I can't see how to register a TOmniEventMonitor object to collect info from the threads that are part of the Pipeline.
What is the best option to get messages back to the UI to update progress for a Parallel.Pipeline task?
In looking at the FileScanner demo, the are doing something like this to create the task.
FFolderScanner := Parallel.Pipeline
.NoThrottling
.Stage(UniqueFilter_asy)
.Stage(FolderScanner_asy)
.NumTasks(inpNumScanners.Value)
.Stage(DataCollector_asy,
Parallel.TaskConfig.OnTerminated(WorkDone)
)
.Run;
How do I link in or use a TOmniEventMonitor that can work with each of the Stages of this Pipeline.
Thanks.
tim