NancyFx/Nancy — pull request #1360 by dot-i (2013-12-09 21:31:46+00:00)
Title: Implemented ConcurrencyMode in self-host and improved async requests

This pull request improves on the async handling of requests when using self-hosting, using the .NET ThreadPool to process incoming requests. The old system of using BeginGetContext() only handled two requests simultaneously -- with the thread-pool many more can run concurrently.

I also added a ConcurrencyMode.Single option to handle requests on a single thread. This can be useful in cases where you need to make sure you always deal with the same thread.

The default is ConcurrencyMode.Multiple (to behave like the self-host has behaved before and for best performance).