Table of Contents

Interface IPriorityQueue

Namespace
Sportradar.LiveData.Sdk.Services.PriorityQueue
Assembly
Sportradar.LiveData.Sdk.dll

Generic priority queue interface

public interface IPriorityQueue

Properties

Count

Number of items in the queue.

int Count { get; }

Property Value

int

Name

Priority queue name

string Name { get; set; }

Property Value

string

QueueStats

Queue statistic (total, daily, hourly, minutely). Various avg/min/max performance queue counters.

IQueueTimeStats QueueStats { get; }

Property Value

IQueueTimeStats

Methods

Clear()

Empties the queue.

void Clear()

Dequeue()

Dequeues an object from the priority queue. Returns null if the queue is empty

PriorityQueueElt Dequeue()

Returns

PriorityQueueElt

The top item (max priority) from the queue or null if it does not exist.

Dequeue(Priority)

Dequeues an object of specific priority from the priority queue. Returns null if the queue is empty.

PriorityQueueElt Dequeue(Priority prio)

Parameters

prio Priority

Priority constraint

Returns

PriorityQueueElt

The top item (max priority) from the queue or null if it does not exist.

Dequeue(Priority, TimeSpan)

Dequeues an object of specific priority from the priority queue.

PriorityQueueElt Dequeue(Priority prio, TimeSpan timeout)

Parameters

prio Priority

Priority constraint

timeout TimeSpan

The number of milliseconds to wait

Returns

PriorityQueueElt

The top item (max priority) from the queue. Returns null in case of timeout.

Dequeue(TimeSpan)

Dequeues an object from the priority queue.

PriorityQueueElt Dequeue(TimeSpan timeout)

Parameters

timeout TimeSpan

The number of milliseconds to wait

Returns

PriorityQueueElt

The top item (max priority) from the queue. Returns null in case of timeout.

Enqueue(PriorityQueueElt)

Enqueues an item to the priority queue.

void Enqueue(PriorityQueueElt obj)

Parameters

obj PriorityQueueElt

The object to be enqueued.

Peek()

Returns the value of the element at the top of the queue (highest priority) without removing it from the queue. Returns with null immediately if the queue is empty.

PriorityQueueElt Peek()

Returns

PriorityQueueElt

The top item (max priority) from the queue or null if it does not exist.

Peek(TimeSpan)

Returns the value of the element at the top of the queue (highest priority) without removing it from the queue.

PriorityQueueElt Peek(TimeSpan timeout)

Parameters

timeout TimeSpan

The number of milliseconds to wait

Returns

PriorityQueueElt

The top item (max priority) from the queue or null if it doesn't exist.