jnunemaker/cassanity — pull request #12 by derekgr (2013-03-06 21:15:12+00:00)
Title: Add retry strategies

Adds some code to retry Cassandra calls on failure with a configurable retry strategy. I want to get a quick :eyes: from @jnunemaker on this approach before going too much farther.

Some questions:
- I inject the retry strategy as a parameter to the `Executor` from the `Client`, which seems fine, but I ran into a test case where `ColumnFamily` instantiates an executor directly. Is specifying the retry strategy as an argument to the `Client` constructor ok?
- I'm making the assumption that executor `#execute` raises something when a Cassandra call fails, but I'm just catching `StandardError`. Should I catch some more specific error types?

The default strategy is `RetryNTimes` with retries = 0, so if you don't configure a retry strategy, everything should behave as before.

Let me know if this looks like the right direction and I'll add an exponential backoff strategy, metrics logging for retries, etc.