Evolution/Evolution/Core/MultithreadedCachedExecutor.cs
/// <summary>
/// Adds a list of tasks to queue and waits until completion
/// </summary>
/// <typeparam name="I">Input v</typeparam>
/// <param name="action">The action.</param>
/// <param name="input">The input.</param>
Adds a list of tasks to queue and waits until completion
Adds a list of tasks to queue and waits until completion
public void AddToQueueAndWait<I>(Action<I> action, IEnumerable<I> input)
        {
            if (UseMultithreading)
            {
                ParallelResult<I, bool> parallelResult = new ParallelResult<I, bool>(input, i =>
                {
                    action(i);
                    return true;
                });
                parallelResult.Run();
            }
            else
            {
                foreach (I i in input)
                {
                    action(i);
                }
            }
        }
public void AddToQueueAndWait < I > ( Action < I > action , IEnumerable < I > input ) { if ( UseMultithreading ) { ParallelResult < I , bool > parallelResult = new ParallelResult < I , bool > ( input , i => { action ( i ) ; return true ; } ) ; parallelResult . Run ( ) ; } else { foreach ( I i in input ) { action ( i ) ; } } }
Adds a list of tasks to queue and waits until completion
Adds a list of tasks to queue and waits until completion
action
Action<I>
None
input
IEnumerable<I>
None
typeparam
None