Class PersistentInMemoryQueue<T>
Persistent queue file format is the following:
1 byte record length length [n];
n bytes record length [m]
m bytes record itself
DELETE marker is byte == (byte)0;
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: FixAntenna.FixEngine.Storage.Queue
Assembly: FixAntenna.Core.dll
Syntax
public class PersistentInMemoryQueue<T> : InMemoryQueue<T>, IQueue<T>, IDisposable where T : IQueueable
Type Parameters
| Name | Description |
|---|---|
| T |
Constructors
PersistentInMemoryQueue(String, IQueueableFactory<T>)
Declaration
public PersistentInMemoryQueue(string filename, IQueueableFactory<T> factory)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | filename | |
| IQueueableFactory<T> | factory |
Fields
DeleteMarker
Declaration
protected static readonly IQueueable DeleteMarker
Field Value
| Type | Description |
|---|---|
| IQueueable |
Methods
Add(T)
Add object to the queue.
Declaration
public override bool Add(T element)
Parameters
| Type | Name | Description |
|---|---|---|
| T | element |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if element added successfully. |
Overrides
FixAntenna.FixEngine.Storage.Queue.InMemoryQueue<T>.Add(T)
AppendEntryToFile(IQueueable)
Appends entry to file.
Methods append entry to file if it is opened.
Method truncates the file only if entry is DeleteMarker and size of file gr OneMeg.
Declaration
public virtual bool AppendEntryToFile(IQueueable entry)
Parameters
| Type | Name | Description |
|---|---|---|
| IQueueable | entry |
Returns
| Type | Description |
|---|---|
| System.Boolean | false if entry doesn't append to file. |
Clear()
Clears the queue.
Declaration
public override void Clear()
Overrides
FixAntenna.FixEngine.Storage.Queue.InMemoryQueue<T>.Clear()
Commit()
Removes polled object from the queue. If nothing was polled - throws IllegalStateException
Declaration
public override void Commit()
Overrides
FixAntenna.FixEngine.Storage.Queue.InMemoryQueue<T>.Commit()
Exceptions
| Type | Condition |
|---|---|
| System.InvalidOperationException |
Initialize()
Initializes queue. That includes restore of previously saved queue content for persistent queues.
Declaration
public override void Initialize()
Overrides
FixAntenna.FixEngine.Storage.Queue.InMemoryQueue<T>.Initialize()
Shutdown()
Gracefully shutdowns queue.
Declaration
public override void Shutdown()
Overrides
FixAntenna.FixEngine.Storage.Queue.InMemoryQueue<T>.Shutdown()
Implements
System.IDisposable