From 98d47ea428cd31b302e33dc6015a889d38bcb267 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 18 Jul 2013 17:17:20 -0700 Subject: Delay the enqueueing of non-longpoll requests for 100ms. No need to have these requests actively on the processing queue if it seems they're not ready. --- .../Servers/HttpServer/PollServiceRequestManager.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs index e811079..727dbe5 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs @@ -96,7 +96,17 @@ namespace OpenSim.Framework.Servers.HttpServer private void ReQueueEvent(PollServiceHttpRequest req) { if (m_running) - m_requests.Enqueue(req); + { + // delay the enqueueing for 100ms. There's no need to have the event + // actively on the queue + Timer t = new Timer(self => { + ((Timer)self).Dispose(); + m_requests.Enqueue(req); + }); + + t.Change(100, Timeout.Infinite); + + } } public void Enqueue(PollServiceHttpRequest req) -- cgit v1.1