Throttled Parallel For Each
Enumerates the elements of a collection and executes an embedded statement for each element of the collection in parallel up to the Max Concurrent Branches. It is similar with ParallelForEach with the difference that it will execute maximum Max Concurrent Branches branches in parallel. The embedded statements are scheduled together and run asynchronously, but unless the scheduled activities themselves are asynchronous (such as messaging activities, InvokeMethod, or activities that derive from AsyncCodeActivity). They do not run on separate threads, so each successive activity will only execute when the previously scheduled activity completes or goes idle. If none of the child activities of this activity are asynchronous or go idle, this activity execute in the same way that a ForEach activity does.
note
Most of the properties on this activity can be set using an expression. That is why when we set a string value, we must put that string value under "".
#
Designer Properties- Item The item of the specified Values collection.
- Values The activity's collection of inputs for the execution of the Body activity action.
- Body The ActivityAction to be executed for each item in the Values collection.
- Max Concurrent Branches The maximum number of branches to be used in parallel until we wait for any running branches to complete in order to start a new one(if any).
#
Properties#
General PropertiesSee General Properties.
#
Misc- Completion Condition Evaluates after any branch completes and completes the activity if it evaluates to true.
- Display Name See Misc.
- Values The activity's collection of inputs for the execution of the Body activity action.
- Max Concurrent Branches The maximum number of branches to be used in parallel until we wait for any running branches to complete in order to start a new one(if any).
#
Out ErrorSee Out Error.
#
ExampleIn this example, we start 5 browser windows, but only 3 will run in parallel, navigate to google, type "test" followed by an enter key and when all the browser windows complete their search, we display Done.