A Cassandra Connection Pool for .NET

posted in
After playing around with Aquiles, HectorSharp, and FluentCassandra, all I really wanted was a Connection Pool and a Thrift Client.  I borrowed the Thrift client from Aquiles and now here's a code snippet with a Connection Pool for .NET.

I'm using some pretty heavy locking but it seems to stop the Port Exhaustion problem.  I also prefer a simple disposable model that relies on the new constructor + IDisposable, similar to how SqlConnection works.  App code tends to look cleaner that way.  I also want to avoid wrapping the core functionality of Cassandra, which is going to change rapidly.  So the goal of the whole thing is to simply expose the Thrift client for anyone to use as they see fit, rather than simplify or abstract how it works.

Here it is, copy away:

Find a problem or mistake? File a bug or better yet, submit a pull request
Copyright © 2010 - 2022 - Doug Tarr