Class SchedulerQueue<TAbsolute>
Efficient scheduler queue that maintains scheduled items sorted by absolute time.
Inherited Members
Namespace: System.Reactive.Concurrency
Assembly: System.Reactive.Core.dll
Syntax
public class SchedulerQueue<TAbsolute>
where TAbsolute : IComparable<TAbsolute>
Type Parameters
Name | Description |
---|---|
TAbsolute | Absolute time representation type. |
Remarks
This type is not thread safe; users should ensure proper synchronization.
Constructors
| Improve this Doc View SourceSchedulerQueue()
Creates a new scheduler queue with a default initial capacity.
Declaration
public SchedulerQueue()
SchedulerQueue(Int32)
Creats a new scheduler queue with the specified initial capacity.
Declaration
public SchedulerQueue(int capacity)
Parameters
Type | Name | Description |
---|---|---|
Int32 | capacity | Initial capacity of the scheduler queue. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException |
|
Properties
| Improve this Doc View SourceCount
Gets the number of scheduled items in the scheduler queue.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
Int32 |
Methods
| Improve this Doc View SourceDequeue()
Dequeues the next work item from the scheduler queue.
Declaration
public ScheduledItem<TAbsolute> Dequeue()
Returns
Type | Description |
---|---|
ScheduledItem<TAbsolute> | Next work item in the scheduler queue (removed). |
Enqueue(ScheduledItem<TAbsolute>)
Enqueues the specified work item to be scheduled.
Declaration
public void Enqueue(ScheduledItem<TAbsolute> scheduledItem)
Parameters
Type | Name | Description |
---|---|---|
ScheduledItem<TAbsolute> | scheduledItem | Work item to be scheduled. |
Peek()
Peeks the next work item in the scheduler queue.
Declaration
public ScheduledItem<TAbsolute> Peek()
Returns
Type | Description |
---|---|
ScheduledItem<TAbsolute> | Next work item in the scheduler queue (not removed). |
Remove(ScheduledItem<TAbsolute>)
Removes the specified work item from the scheduler queue.
Declaration
public bool Remove(ScheduledItem<TAbsolute> scheduledItem)
Parameters
Type | Name | Description |
---|---|---|
ScheduledItem<TAbsolute> | scheduledItem | Work item to be removed from the scheduler queue. |
Returns
Type | Description |
---|---|
Boolean | true if the item was found; false otherwise. |