basho-labs/CorrugatedIron — pull request #202 by taliesins (2014-10-20 18:51:03+00:00)
Title: Async IO, connection pooling and idle timeouts

This is quite a large pull request, as the functionality is a shift in the way communication is done. I monkey patched it from my version as I have a very messy git history and a lot of stuff that shouldn't make it into this pull request. All tests are passing and performance looks way better.

* Make use of SocketEventArgs
* Make use of pooling for SocketEventArgs (reduction in GC)
* Make use of pooling for socket buffer (reduction in GC)
* Async socket methods used
* Connection pooling
* Connection idling implemented
* Sync client uses async client
* Tasks and observables are now returned from client (this will cause some easy to fix breaking changes in apps that use the client)
* Queuing of connections implemented for on the fly connections. Once threshold is reached queuing will begin, to not overload Riak server

The retry logic around requests is no longer necessary. Previously under load connections would fail. Now I consistently get 100% pass rate in the load tests (OnTheFly and ConnectionPool). Average times moved from 56ms to 19ms on my machine.

Only real network issues or overloaded Riak nodes should result in exceptions. This is the expected behavior of most clients. Retry logic can be implemented at a higher level.

Note: I have updated the project to use .net 4.5.

Regards
Taliesin