using System;
namespace PepperDash_Essentials_Core.Queues
{
///
/// String implementation of Action Queue
///
public class StringQueue : IQueue
{
private readonly IQueue _queue;
///
/// Constructor for BytesQueue
///
/// Key
/// Action to process queued strings
public StringQueue(string key, Action processStringAction)
{
_queue = new GenericQueue(key, processStringAction);
}
///
/// Constructor for StringQueue
///
/// Key
/// Action to process queued strings
/// Delay in ms between actions being invoked
public StringQueue(string key, Action processStringAction, int pacing)
{
_queue = new GenericQueue(key, processStringAction, pacing);
}
///
/// Enqueue a byte array to be processed
///
/// Byte array to be processed
public void Enqueue(string item)
{
_queue.Enqueue(item);
}
///
/// Key
///
public string Key
{
get { return _queue.Key; }
}
///
/// Disposes of resources
///
public void Dispose()
{
_queue.Dispose();
}
///
/// If the instance has been disposed
///
public bool Disposed
{
get { return _queue.Disposed; }
}
}
}