jorgebay/node-cassandra-cql — pull request #88 by garo (2014-05-21 07:37:20+00:00)
Title: Remove 10ms delay when one C* node is down

the checkNextConnection used setTimeout() to call checkNextConnection
on a 10ms delay. This is not needed and its better replaced with
setImmediate().

setImmediate was introduced in node 0.10 which is already the
minimal requirements in package.js so this should not break
backward compatibility.

Here's a screenshot from production environment where the patch was applied. The blue graph shows mean time to complete one SELECT operation and the green graph shows how long the longest 10% of those SELECT operations took. I'm still not totally happy because the dropped cassandra node still causes additional delay to the requests but this patch at least eliminates some of that latency.
![remove10msdelaywhennodeisdown](https://cloud.githubusercontent.com/assets/381921/3037221/53612500-e0ba-11e3-9a22-584499113505.png)

The tests did not pass because the err was undefined instead of null so I changed the strictEqual to equal. All tests passed after this change.