Is there a way to process all client requests sequentially on a .NET Framework WebAPI?

I’ve recently begun working with a WebAPI that sends requests to a printer module, but during testing I have noticed that when two clients send a request concurrently, the printer stops and blocks out all further commands. I have tried this answer here, but context.Request.RequestContext.RouteData comes empty. So, I would like to find a way to buffer all requests sent to a WebAPI Controller. I am on .NET Framework 4.5.2.

Answer

I solved this issue by using a static ConcurrentQueue and Monitor-ing every request to lock the thread until the printing is completed. It worked beautifully. Here’s the code:

private static void tryQueue (FiscalPrinterParameters printerParameters){ 
            RequestQueue.Queue.Enqueue(printerParameters);
            bool acquiredLock = false;
            /*
             Since every API Call starts a new thread and therefore starts the printing process, 
            the RequestQueue is monitored and locked when it's used to prevent printers locking up during printing.
             */
            try
            {
                while (!acquiredLock)
                {
                    Monitor.TryEnter(RequestQueue.Queue, 500, ref acquiredLock);
                }
                if (acquiredLock)
                {
                    foreach (var item in RequestQueue.Queue)
                    {
                       /*Printer code here*/

                    }
                }
            }
            catch (Exception e) {
                Logger.Error(e);
                throw e;
            }
            finally
            {
                if (acquiredLock)
                {
                    Monitor.Exit(RequestQueue.Queue);
                }
            }
}