Created
October 22, 2020 14:14
-
-
Save norus/af5fdf986941026e19b00aac6caa3c76 to your computer and use it in GitHub Desktop.
Redis protocol generation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def redis_protocol(cmd): | |
| proto = "*%d\r\n" % len(cmd.split(' ')) | |
| for arg in cmd.split(' '): | |
| proto += "$%d\r\n%s\r\n" % (len(arg), arg) | |
| return proto |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment