Android | Handler

Main usage scenarios of Handler When the child thread completes the time-consuming operation, it sends a message Message to the main thread through Handler to update the UI interface. Because Android updates the UI in the main thread, when time-consuming operations occur on the main thread, it will cause the user interface to freeze, so […]

[Signal] Signal saving {Data structure for managing signals: pending, block, handler; signal set; sigset_t type; signal set operation function; related system calls: sigpending, sigprocmask}

1. Related concepts Signal delivery: The actual processing action of executing the signal is called signal delivery (Delivery), including default, ignore and custom capture. Signal pending: The state between signal generation and delivery is called signal pending (Pending). Therefore, the signal bitmap mentioned above is also called Pending bitmap. Signal blocking (shielding): A process can […]

The source code of the handler process for receiving Rest requests is built when Elasticsearch 8.9 starts.

1. Main mode entrance 2. The third phase of Elasticsearch initialization 1. Construct restController when constructing node node object 2. Perform the operation of initializing RestHanders at the end of the node construction object. 3. Take the RestGetIndicesAction object registered in the handler as an example. 1. Inherited BaseRestHandler, the routes method is used as […]

mybatis custom type controller (TypeHandler) processes strings as collections

1. Question: Assume such a scenario The value in localurl is roughly like this: dwad21.jpg, dwad22.jpg, dwad.23.jpg is a string If I have a field (local_url) in the sql table that is the concatenation value of multiple url strings of local image resources. I want to get value plus value without extra conversion in java […]

SpringBoot HandlerInterceptor actual combat

HandlerInterceptor 1. Introduction to interceptors 1.1 Interface method description 1.1.1 preHandle 1.1.2 postHandle 1.1.3 afterCompletion 1.2 Basic usage examples 1.2.1 Implement custom interceptor 1.2.2 Register interceptor 2. Actual combat 2.1 Practical combat one: Obtain controller method annotation authentication through interceptor 2.1.1 Define permission annotations 2.1.2 Implement permission interceptor (implement HandlerInterceptor interface) 2.1.3 Configuring interceptors 2.1.4 […]

Android Handler synchronization barrier

What is the synchronization barrier mechanism The synchronization barrier mechanism is a set of mechanisms to allow certain special messages to be executed faster. Here we assume a scenario: we send a UI drawing operation Message to the main thread, and there are many messages in the message queue at this time. Then the processing […]

Handler-ThreadLocal analysis

ThreadLocal source code analysis Under Android’s Handler mechanism, ThreadLocal provides the storage of copies of local variables of different threads, and realizes the isolation of thread data, so that the data of different threads will not be confused. And after a thread ends, its corresponding data in ThreadLocal will be released, unless there are references […]

16 | How to customize HandlerMethodArgumentResolvers

In the previous lecture, we introduced the usage of the SpringDataWebConfiguration class, so this time we take a look at how this class is loaded, how PageableHandlerMethodArgumentResolver and SortHandlerMethodArgumentResolver take effect, and how to define your own HandlerMethodArgumentResolvers class. Are there any other web scenarios that require it? What about our customization? Regarding the above […]