B-Arts DocumentationIndice generale

BThreadQueue - Esempi

BThreadQueue queue = new BThreadQueue(NumberOfTaskExecuting: 2);
queue.AddTask(new ExportThread { Nome = "Report A" });
queue.AddTask(new ExportThread { Nome = "Report B" });

queue.AllTaskCompleted += (_, _) => OnExportsCompleted();
queue.Execute();

Execute avvia i thread fino al limite configurato ma può restituire prima della conclusione degli ultimi thread. Usare AllTaskCompleted per sapere quando l'intero gruppo è terminato.