我正在尝试做的事情:
从 MasterQueue 发送一个单独的队列到他们自己的异步工作者
等待所有异步工作人员完成并返回结果
订单结果的顺序与它们在 MasterQueue 中的顺序相同
<Queue<Queue<object[]>> MasterQueue = new Queue<Queue<object[]>>();
while (MasterQueue.Count > 0)
{
Queue<object[]> Queue = MasterQueue.Dequeue();
//Send Queue to an Async Worker for processing...
//Lets say 5 in total that finish randomly so 3, 2, 5, 4, 1
}
//Wait for all 5 Async workers to finish and return their work, then use the work in original order...
//Use work from 1
//Use work from 2
//Use work from 3
//Use work from 4
//Use work from 5