Redis Learning Notes-command execution flow

Source: Internet
Author: User
Basic Knowledge Section

If you need to master the implementation of the entire Redis command, then you must master some basic concepts! Otherwise do not understand, below I have some in my opinion necessary basic knowledge to summarize, hope can for the subsequent command of the entire implementation process to pave the way.

Event

The Redis server is an event driver and the server needs to handle the following two types of events:

  • File event: The Redis server connects to the client (or other Redis server) through a socket, and the file event is the server's abstraction of the socket operation. The communication between the server and the client (or other server) generates corresponding file events, and the server completes a series of network communication operations by listening for and processing these events;
  • • Time Event: Some operations in the Redis server (such as the Servercron function) need to be performed at a given point in time, and the time event is the server's abstraction of such timed operations.
File events

The file event handler is the function that is used to handle this file event when the file event is generated;

  • The file event handler uses an I/O multiplexing (multiplexing) program to listen to multiple sockets at the same time and correlate different event handlers for sockets based on the tasks currently performed by the socket;
  • When a listening socket is ready to perform an operation such as a connection answer (accept), read (read), write (write), close (close), the file event corresponding to the operation is generated, and the file event handler invokes the associated event handler before the socket to handle these events.
  • Cond....

Redis Learning Notes-command execution flow

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.