private void PerformRequest() { while (running) { Request request; bool completed = requests.TryDequeue(out request); if (completed) { request.Perform(); } completedRequests.Enqueue(request); Thread.Sleep(sleepMilliseconds); } }
public void QueueRequest(Request request) { request.PrePerformance(); requests.Enqueue(request); }