Class KeyedActionQueue<TKey>
public class KeyedActionQueue<TKey> where TKey : notnull
Type Parameters
TKey
- Inheritance
-
KeyedActionQueue<TKey>
- Inherited Members
- Extension Methods
Constructors
KeyedActionQueue(int)
Initializes a new instance of the FastKeyedActionQueue with specified initial capacity
public KeyedActionQueue(int capacity = 1024)
Parameters
capacityint
Properties
Count
Gets the current count of queued actions
public int Count { get; }
Property Value
Methods
Clear()
Removes all queued actions
public void Clear()
ContainsKey(TKey)
Checks if a key exists in the queue
public bool ContainsKey(TKey key)
Parameters
keyTKey
Returns
Dequeue()
Dequeues the next action in FIFO order
public Action? Dequeue()
Returns
Enqueue(TKey, Action)
Enqueues an action with a key, removing any existing action with the same key
public void Enqueue(TKey key, Action action)
Parameters
keyTKeyactionAction
ExecuteAll()
Dequeues and executes all actions in FIFO order
public void ExecuteAll()
TryRemove(TKey)
Tries to remove an action by key
public bool TryRemove(TKey key)
Parameters
keyTKey