scala-redis
scala-redis copied to clipboard
Make sure Redis.send(..) methods are tail recursive
We need to do that cause if we have a faulty Redis server that has issues with connections the reconnect-on-error functionality of those methods can result in StackOverflowError
.
We had to create a private method for each send(..)
method cause simply adding @tailrec
would produce the following compiler error: "could not optimize @tailrec annotated method send: it is neither private nor final so can be overridden". We also opted for adding private methods instead of defining them inside each method in order to make fewer changes and better preserve the git history.