Package deltix.qsrv.hf.blocks
Class PooledMarketMessageQueue
- java.lang.Object
-
- deltix.qsrv.hf.blocks.PooledMarketMessageQueue
-
- All Implemented Interfaces:
MarketMessageQueue<deltix.timebase.api.messages.MarketMessage>
public final class PooledMarketMessageQueue extends java.lang.Object implements MarketMessageQueue<deltix.timebase.api.messages.MarketMessage>
-
-
Constructor Summary
Constructors Constructor Description PooledMarketMessageQueue(int size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(deltix.timebase.api.messages.MarketMessage msg)
Adds element to the tail of the queue.void
dispose()
boolean
isEmpty()
boolean
isFull()
deltix.timebase.api.messages.MarketMessage
peek()
Retrieves, but does not remove, the head of this queue, or returnsnull
if this queue is empty.deltix.timebase.api.messages.MarketMessage
peekLast()
Retrieves, but does not remove, the tail of this queue, or returnsnull
if this queue is empty.void
release(deltix.timebase.api.messages.MarketMessage msg)
deltix.timebase.api.messages.MarketMessage
remove()
Retrieves and removes the head of this queue, or returnsnull
if this queue is empty.int
size()
-
-
-
Method Detail
-
add
public void add(deltix.timebase.api.messages.MarketMessage msg)
Description copied from interface:MarketMessageQueue
Adds element to the tail of the queue. If capacity is exceeded new element overrides the oldest one (head)- Specified by:
add
in interfaceMarketMessageQueue<deltix.timebase.api.messages.MarketMessage>
-
remove
public deltix.timebase.api.messages.MarketMessage remove()
Description copied from interface:MarketMessageQueue
Retrieves and removes the head of this queue, or returnsnull
if this queue is empty.- Specified by:
remove
in interfaceMarketMessageQueue<deltix.timebase.api.messages.MarketMessage>
- Returns:
- the head of this queue, or
null
if this queue is empty
-
release
public void release(deltix.timebase.api.messages.MarketMessage msg)
- Specified by:
release
in interfaceMarketMessageQueue<deltix.timebase.api.messages.MarketMessage>
-
peek
public deltix.timebase.api.messages.MarketMessage peek()
Description copied from interface:MarketMessageQueue
Retrieves, but does not remove, the head of this queue, or returnsnull
if this queue is empty.- Specified by:
peek
in interfaceMarketMessageQueue<deltix.timebase.api.messages.MarketMessage>
-
peekLast
public deltix.timebase.api.messages.MarketMessage peekLast()
Description copied from interface:MarketMessageQueue
Retrieves, but does not remove, the tail of this queue, or returnsnull
if this queue is empty.- Specified by:
peekLast
in interfaceMarketMessageQueue<deltix.timebase.api.messages.MarketMessage>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceMarketMessageQueue<deltix.timebase.api.messages.MarketMessage>
-
isFull
public boolean isFull()
- Specified by:
isFull
in interfaceMarketMessageQueue<deltix.timebase.api.messages.MarketMessage>
-
size
public int size()
- Specified by:
size
in interfaceMarketMessageQueue<deltix.timebase.api.messages.MarketMessage>
-
dispose
public void dispose()
- Specified by:
dispose
in interfaceMarketMessageQueue<deltix.timebase.api.messages.MarketMessage>
-
-