Reactor Part 10 Customize a production WebClient

1 Why use WebClient When first trying to use Spring WebFlux, many people will use Mono.fromFuture() to convert asynchronous requests into Mono objects, or Mono.fromSupplier() to convert requests into MOno objects, both of which are in reactive programming. Not recommended, will block the current thread. 1.1 Mono.fromFuture() VS WebClient There are the following differences between […]

epoll+reactor combination

Background 1. Use background and overall structure 2. How to use epoll 3. Understand the reactor (reactor) mode 4. epoll + reactor joint 1.1 Why IO multiplexing occurs Compared with the traditional simple tcp server, the user connection is based on threads, that is, when a new client (new fd) is connected, the server will […]

Talk about the network reactor mode and millions of concurrency in a simple way

This blog post talks about the reactor network processing model around the millions of concurrent server network connections, and will answer the following questions: 1. What is the reactor mode, 2. Why is there a reactor mode, 3. The bottleneck of network concurrency Where, 4. Take the http connection as an example to explain how […]

Reactor principle and implementation

1. reactor model What is a reactor? reactor refers to a high-performance processing mechanism under the select, poll, and epoll network models in multiple I/O multiplexing. reactor Interpretation of “reactor”, is an event-driven mechanism. The calling mechanism of ordinary functions: The program calls a function, the function executes, the program waits, the function returns the […]

Linux c/c++ server development – network programming – reactor model

#include <stdio.h> #include <errno.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/socket.h> #include <netinet/in.h> #include <fcntl.h> #include <pthread.h> #include <sys/poll.h> #include <sys/epoll.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/sendfile.h> #define BUFFER_LENGTH 1024 #define EVENT_LENGTH 512 typedef int (*callback)(int fd, int events, void *arg); typedef struct connect_s {<!– –> int fd; callback cb; \t char rbuffer[BUFFER_LENGTH]; int […]

Linux c/c++ server development-network programming-reactor model simple http server application

#include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/socket.h> #include <sys/epoll.h> #include <arpa/inet.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <errno.h> #include <sys/time.h> #include <sys/sendfile.h> #define BUFFER_LENGTH 1024 #define MAX_EPOLL_EVENTS 1024 #define RESOURCE_LENGTH 1024 #define SERVER_PORT 8888 #define PORT_COUNT 1 typedef int NCALLBACK(int ,int, void*); #define HTTP_METHOD_GET 0 #define HTTP_METHOD_POST 1 int curfds = […]

Multiplexing – select, poll and epoll and Reactor mode

In the Linux system, multiplexing (Multiplexing) is an important event processing mechanism, which allows a process or thread to monitor multiple file descriptors (sockets, files, etc.) at the same time, and then extract multiple ready Event file descriptors are processed one by one. Combining multi-process, multi-thread and multi-path transfer is a common method to realize […]

Explore the innovation of Reactor network model in today’s application field

This article is shared from Huawei Cloud Community “Controlling the Future of Network Technology: Exploring the Innovation of the Reactor Network Model in Today’s Application Fields”, author: Lion Long. This article introduces the Reactor network model in Linux network design and its importance in practical applications. The Reactor model is a classic event-driven design pattern […]

FluxMQ-Version 2.0 Update Content Preface FLuxMQ is a cloud-native distributed IoT access platform developed based on java and supporting unlimited device connections. FluxMQ is developed based on Netty, and the bottom layer adopts the Reactor3 reactor model, which has low latency

Foreword FLuxMQ is a cloud-native distributed IoT access platform developed based on java and supporting unlimited device connections. FluxMQ is developed based on Netty, and the bottom layer adopts the Reactor3 reactor model, which has low latency, high throughput, and tens of millions or billions of device connections; it is convenient for enterprises to quickly […]

[High concurrent network communication architecture] 4. Efficient event-driven model: Reactor model

Directory 1. Previous articles 2. Basic concepts 1 Introduction 2. Basic framework 3. Core features 4. Workflow 5. Use “network communication” to understand the Reactor model Three, code implementation 1. Use epoll for multiplexing to realize the operation process of Reactor mode 2. Reactor mode implementation code (reference) One, previous articles [High concurrent network communication […]