Пример #1
0
 private static void PlaceOrder(ITradingEngine engine, ConcurrentQueue <Order> orders)
 {
     while (orders.TryDequeue(out var order))
     {
         engine.PlaceAsync(order);
     }
 }
Пример #2
0
        private static void PlaceOrder(ITradingEngine engine, ConcurrentQueue <Order> orders)
        {
            Order order;

            while (orders.TryDequeue(out order))
            {
                Console.WriteLine("PlaceAsync: " + order + " Thread: " + Thread.CurrentThread.ManagedThreadId);
                engine.PlaceAsync(order).GetAwaiter().GetResult();
            }
        }