I understand the basic of how to use asynchronous in asp.net, and use it everyday.
Now I expect that I could do better, fully decouple the request and response in asynchronous way, like what we had before, in .net 2 style.
My web application receives requests, converts the requests to messages, and sends these messages to a messaging system; then uses await to wait the response from the messaging system, using rpc style. This requires me to create a new queue (or get a unique queue from the pool) and listen on this queue. The number of the queues could be large when the system is busy, and it doesn't make much sense to create a queue then tear it down just a little bit later.
I wish only one queue can be used. Several threads of the web application can sit there listening to that queue. When a response message is available from the messaging system and is picked up by a thread, the thread may find the corresponding http request context, and send the response back using the http context.
From my memory, asp.net asynchronous used to work in this way. Does anybody know how to do this in web api?