Пример #1
0
 private void EnqueueAndSuccess(Offer <TOut> offer)
 {
     _buffer.Enqueue(offer.Element);
     offer.CompletionSource.NonBlockingTrySetResult(QueueOfferResult.Enqueued.Instance);
 }
Пример #2
0
 /// <summary>
 /// TBD
 /// </summary>
 /// <param name="element">TBD</param>
 public void Enqueue(T element) => _q.Enqueue(element);
Пример #3
0
 // Receive updates from the backend, parse them and delegate to the
 // classes in charge of creating, deleting and updating game objects.
 void RenderGameState(GameStateDTO gameStateDTO)
 {
     gameStateBuffer.Enqueue(gameStateDTO);
 }
Пример #4
0
        public void TestPop()
        {
            var a = new GameStateDTO();

            Assert.IsFalse(buffer.HasNext());
            buffer.Enqueue(a);
            Assert.IsTrue(buffer.HasNext());
            Assert.AreEqual(buffer.Pop(), a);
        }
Пример #5
0
 private void EnqueueAndSuccess(TOut element, Offered promise)
 {
     _buffer.Enqueue(element);
     promise.SetResult(QueueOfferResult.Enqueued.Instance);
 }