en en en en en en en en en en en en en en en en en en en en en en en en en en pt en en en en en en en en sv fr fr en en en en en en
When you have a collection of objects and would like to process than via a logic document (i.e., rules), you can process them one-by-one in your code, or you can ask the engine to process them collectively.
If you process the objects one-by-one, you would have something similar to the code shown below:
If the number of items in the collection is big, then it is worth parallelising the execution. This is achieved simply by using standard .Net Parallel API.
Changing the normal for and loops to a Parallel is no different at all from the normal usage pattern of Parallel.
Parallel.ForEach(collection, (item)=> { engine.Run(item); });
When you need to access the result of the execution from the engine after processing, then use the concurrent dictionary with the actual object as a key to store engine results locally if you need to process them later.
ConcurrentDictionary  results = new ConcurrentDictionary (); Parallel.ForEach(collection, (item)=> { results[item] = engine.Run(item); });