News for hackers. Stuff that matters.
Re:Reading and Writing Redis Protocol in Go by laurent123456 on Monday May 19, 2014 @02:34PM (#7768991)
I wonder why "\r\n" and not just "\n" is the string separator in RESP. I get that it needs to be human readable but \n should be enough to make it readable in any text viewer. Or is there something more to it?
Re:Reading and Writing Redis Protocol in Go by ominous_prime on Monday May 19, 2014 @03:07PM (#7769171)
Probably only because CRLF is sort of the network line ending standard, used in many common protocols like http, imap, smtp, etc.
Re:Reading and Writing Redis Protocol in Go by benmanns on Monday May 19, 2014 @03:06PM (#7769164)
I was wondering the same thing. Perhaps "\r\n" is more friendly to Windows or Telnet users?
Re:Reading and Writing Redis Protocol in Go by pkulak on Monday May 19, 2014 @03:42PM (#7769355)
I wonder why errors and simple strings aren't just length-delimited as well. What do you gain by having both methods in one protocol?
Re:Reading and Writing Redis Protocol in Go by Zikes on Monday May 19, 2014 @07:59PM (#7770544)
I think human readability was something antirez really wanted, and having explicit line delimeters would make it easy to visually parse in a telnet session or building/debugging a client.
Re:Reading and Writing Redis Protocol in Go by sunseb on Monday May 19, 2014 @05:36PM (#7769880)
It's similar to HTTP chunked transfer encoding :

http://en.wikipedia.org/wiki/Chunked_transfer_encoding

And why did they choose these prefix chars ($, *, +, -) ?