Maybe.
What does this service actually do?
The idea is a simple MSMQ.
Queue.Add
T Queue.Next
Etc.
The reason for this is to implement the design pattern for "local queuing" of work for the sake of high-performance apps. The idea is to acknowledge to the user to intent to do the work, but to delay the work for the sake of 1) batch 2) continued responsiveness and 3) delayed for undo. I want to build a simple implementation that doesn't reinvent the wheel. Supporting most cases and allowing it to be extensible for other uses. Make sense?
sounds really good
Something like this perhaps.
public class Queue<T>
{
public static Queue<T> Instance { get; } = new Queue<T>();
private Queue()
{
// private constructor
}
System.Collections.Generic.Queue<T> queue
= new System.Collections.Generic.Queue<T>();
public event TypedEventHandler<T> Enqueued;
public void Enqueue(T item)
{
Enqueue(item);
Enqueued?.Invoke(null, item);
}
public event TypedEventHandler<T> Dequeued;
public T Dequeue()
{
var item = Dequeue();
Dequeued?.Invoke(null, item);
return item;
}
}
Not a bad idea. I'll start working on a basic implementation for testing. I'm on school holidays at the moment; it's not like I've got any better use for my time.
Most helpful comment
The idea is a simple MSMQ.(T message);();
Queue.Add
T Queue.Next
Etc.
The reason for this is to implement the design pattern for "local queuing" of work for the sake of high-performance apps. The idea is to acknowledge to the user to intent to do the work, but to delay the work for the sake of 1) batch 2) continued responsiveness and 3) delayed for undo. I want to build a simple implementation that doesn't reinvent the wheel. Supporting most cases and allowing it to be extensible for other uses. Make sense?