Interface IQueue<T>
IQueue interface.
Inherited Members
Namespace: FixAntenna.FixEngine.Storage.Queue
Assembly: FixAntenna.Core.dll
Syntax
public interface IQueue<T> : IDisposable where T : IQueueable
Type Parameters
Name | Description |
---|---|
T |
Methods
Add(T)
Add object to the queue.
Declaration
bool Add(T element)
Parameters
Type | Name | Description |
---|---|---|
T | element | the element |
Returns
Type | Description |
---|---|
System.Boolean | true if element added successfully. |
AddOutOfTurn(T)
Add object to the queue out of turn.
Declaration
bool AddOutOfTurn(T element)
Parameters
Type | Name | Description |
---|---|---|
T | element | the element |
Returns
Type | Description |
---|---|
System.Boolean | true if element added successfully. |
Clear()
Clears the queue.
Declaration
void Clear()
ClearOutOfTurn(Action<T>)
Removes the elements which were added by AddOutOfTurn(T).
Declaration
void ClearOutOfTurn(Action<T> elementConsumer)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T> | elementConsumer | callback for each removed message. It is called after removing next message. |
Commit()
Removes polled object from the queue. If nothing was polled - throws IllegalStateException
Declaration
void Commit()
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException |
Initialize()
Initializes queue. That includes restore of previously saved queue content for persistent queues.
Declaration
void Initialize()
IsAllEmpty()
Declaration
bool IsAllEmpty()
Returns
Type | Description |
---|---|
System.Boolean |
IsEmpty()
Checks if queue is currently empty.
Declaration
bool IsEmpty()
Returns
Type | Description |
---|---|
System.Boolean | true if empty |
IsOutOfTurnOnlyMode()
Out of turn messages only mode.
Declaration
bool IsOutOfTurnOnlyMode()
Returns
Type | Description |
---|---|
System.Boolean |
NotifyAllApplication()
Notify a new application message exists.
The methods works only if turn "mode on" is off.
Declaration
void NotifyAllApplication()
See Also
NotifyAllSession()
Notify a new session message exists.
Declaration
void NotifyAllSession()
Poll()
Poll object from the queue (doesn't remove it from queue yet!).
Declaration
T Poll()
Returns
Type | Description |
---|---|
T | the head of this queue, or null if this queue is empty |
See Also
SetOutOfTurnOnlyMode(Boolean)
Out of turn messages only mode.
Declaration
void SetOutOfTurnOnlyMode(bool mode)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | mode | the mode |
Shutdown()
Gracefully shutdowns queue.
Declaration
void Shutdown()
Size()
Returns current queue size.
Declaration
int Size()
Returns
Type | Description |
---|---|
System.Int32 | queue size |
ToArray()
Return all objects in the queue as array. Method has no impact on poll / commit operations.
Declaration
IQueueable[] ToArray()
Returns
Type | Description |
---|---|
IQueueable[] | array of IQueueable |
TotalSize()
Returns current total queue size. The total size of the usual queue and the OutOfTurn queue.
Declaration
int TotalSize()
Returns
Type | Description |
---|---|
System.Int32 | queue size |