Step 2 - Challenge: Handling PING and ECHO Commands
Step 2 - Challenge: Handling PING and ECHO Commands
Build Your Own Redis Server (Python Edition)
Step 1 - Introduction to RESP, Building a Protocol Handler Using Test-Driven Development
Step 1 - Introduction to RESP, Building a Protocol Handler Using Test-Driven Development
Step 2 - Creating a Network Client and Server
Step 2 - Creating a Network Client and Server
Step 4 - Handling Concurrency
Step 4 - Handling Concurrency
Step 5 - Implementing Expiry
Step 5 - Implementing Expiry
In this step your goal is to create the Redis Lite server. It should start up and begin listening for clients on the port: 6379.
When a client connects, you will want to accept the connection and then begin handling commands sent via the RESP protocol - using the serialiser and deserialiser you built in Step 1.
The simplest and most obvious command to implement is PING.
When your Redis server receives the command ping, it should response with PONG.
% redis-cli PING
PONGAfter that you should implement the ECHO command so we can be terribly traditional and do “Hello World”:
% redis-cli ECHO "Hello World"
"Hello World"