Asynchronous non-blocking with Nginx

In actual development, asynchrony needs to be used for different businesses

The focus of synchronization and asynchronous is on the way of message notification, that is, the way of calling result notification. 
  Synchronization: When a synchronous call is issued, the caller has to wait for the notification of the call result before performing subsequent executions. 
  Asynchronous: When an asynchronous call is issued, the caller cannot immediately get the result of the call back. 
  
There are generally two ways to obtain the result of an asynchronous call: 
  1. Actively poll the result of the asynchronous call; 
  2. The callee notifies the caller of the result of the call through callback

Configuration operation:
find the Nginx configuration file /usr/local/nginx/conf/nginx.conf

find configuration

events {
    worker_connections 1024;
    use kqueue; # Configure in Linux: use epoll;
}

Replacing the above comment position with epoll can process the received event into a non-blocking request processing.


 

{{o.name}}
{{m.name}}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324094053&siteId=291194637