private void Put(long key, long bid, long ask)
            {
                var success = _snapshotBuffer.Offer(key, MarketSnapshot.CreateMarketSnapshot(key, bid, ask));

                if (!success)
                {
                    throw new Exception("adding of key " + key + " failed");
                }
            }
Beispiel #2
0
        private void CheckCapacity(int capacity, ICoalescingBuffer <long, MarketSnapshot> buffer)
        {
            Assert.AreEqual(capacity, buffer.Capacity());

            for (int i = 0; i < capacity; i++)
            {
                bool success = buffer.Offer(MarketSnapshot.CreateMarketSnapshot(i, i, i));
                Assert.True(success);
            }
        }