request, processing, and result return for Redis commands

Source: Internet
Author: User
Tags redis

When the client connects to the server, the client can send a command request to the server.

To send a command request from the client to the command to be processed by the server and return the result to the client, the process has the following steps:

1. The client transmits the command protocol data to the server through a socket.

2. The server processes the incoming data through a read event and saves the data in the client's query cache for the redisclient structure.

3. Based on the contents of the client query cache, the program looks for the implementation function of the corresponding command from the command table.

4. The program executes the command implementation function, modifies the server's global state server variable, and saves the execution result of the command to the client redisclient structure's reply cache, and then writes the event for the client's FD association.

5. When the write event of the client FD is ready, the result of the command in the reply cache is passed back to the client. This completes the command execution.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.