redis-rb
redis-rb copied to clipboard
Explicitly raise InvalidResponse if commands and responses counts don't match
As discussed in https://github.com/redis/redis-rb/pull/509
The idea here is to fail loudly if such unlikely race condition happened.
@djanowski is this more acceptable to you?
I fixed the typo, and refactored ProtocolError so I can reuse it.
I honestly think the pop is simpler and better than the copy. I mean I get your point about not mutating arguments, but in this case it's a method responsible for parsing a response. So I really don't expect any further usage of that object.
That being said I don't think super strongly about it. So I can totally do a slice instead. Just let me know.
We no longer need this because pipelines are serialized eagerly.