public void ProcessRequest(API.Request request) { String requestType = request.GetType().Name; String processorName = requestType.Substring(0, requestType.Length - 2); Processor processor; if(_processors.TryGetValue(processorName, out processor)) { ThreadPool.QueueUserWorkItem(delegate { RunProcessor(request, processor, processorName); }); } else { Logger.Error("Failed to find a processor for " + processorName); SendResponse(new ErrorRs() { error = "INTERNAL_SERVER_ERROR", errorMessage = "Failed to find a processor for " + processorName },request); } }