RocketMQ source code: Producer startup analysis
This paper mainly analyzes the startup process of Producer in RocketMQ.
The version of RocketMQ is: 4.2.0 release.
1, Sequence diagram
According to the source code, the timing of the Producer startup process is drawn once:
2, Source code analysis
1 start(): DefaultMQProducer starts.
The main functions of DefaultMQProducer are impl ...
Posted by pjleonhardt on Wed, 01 Jan 2020 06:57:01 -0800
glide installation dependency error Cannot detect VCS
Today, when using glide to install golang project dependencies, an error is reported as follows: (the second time, make a record today)
[ERROR] Failed to set version on golang.org/x/sys/unix to : Cannot detect VCS
[ERROR] Failed to set version on golang.org/x/text/transform to : Cannot detect VCS
[ERROR] Failed to set version on golang.org/x ...
Posted by chatmaster on Wed, 01 Jan 2020 00:25:28 -0800
Practice of Android Dagger (IV) MVVM mode Kotlin
introduce
Learn some basic knowledge first
@Binds
@IntoSet @IntoMap @IntoXXXX
Let's first introduce how to design MVVM when it is not dagger2
If you don't know how to use databinding, the following video is recommended
Android Data Binding practice - Beginner Level
Android Data Binding practice - Advanced
Let's p ...
Posted by cosmicsea on Wed, 01 Jan 2020 00:19:28 -0800
javascript to view uploaded pictures in real time
Catalog
Catalog
Effect
Code
js
html
Actual code Download
Shortcut links
Effect
Code
js
function UploadImg(file) {
var MAXWIDTH = 260;
var MAXHEIGHT = 180;
var div = document.getElementById('preview');
if (file.files && file.files[0]) {
div.innerHTML = '<img id=i ...
Posted by cooldude832 on Tue, 31 Dec 2019 16:26:07 -0800
Operation details and examples of Rxjava2 connectable Observable
Briefly:
Requirements understanding:
Ordinary Observable in Rxjava will transmit data when the observer subscribes, but sometimes we want to control the data transmission by ourselves. For example, we need to use the connectable Observable in Rxjava to fulfill this requirement after having a specified observer or all observers subscribing.
This ...
Posted by hmb3801 on Tue, 31 Dec 2019 13:41:34 -0800
iOS | simple factory
The essence of the simple factory pattern is that a factory class dynamically determines which instances of a product class should be created (these product classes inherit from a parent class or interface) according to the parameters passed in. ——Baidu Encyclopedia
Picture from Baidu Encyclopedia
For example:
F ...
Posted by tress on Tue, 31 Dec 2019 13:25:26 -0800
RN + head navigation bar + pull-up refresh pull-down load + list + details
-
1. * create head navigation bar
*
import React from "react";
import { createTabNavigator } from "react-navigation";
import List from "./List";
//Add a reuse
const Good = () => {
return <List />;
};
const Share = () => {
return <List />;
};
const Ask = () => {
return <List />;
};
const Jo ...
Posted by fahhem on Tue, 31 Dec 2019 09:19:36 -0800
java uses morphia to access enumeration as value
Source code
https://github.com/zhongchengyi/zhongcy.demos/tree/master/mongo-morphia-demo
Preface
Morphia is a library that java uses orm to operate mongodb. But by default, when using morphia to access enum, it is accessed by name. We need to access enum by value.
As shown in the figure: the schoolClassLevel1 field is accessed by enum name ...
Posted by nanny79 on Tue, 31 Dec 2019 06:59:46 -0800
JS template engine art template
Art template is a simple and super fast template engine.
It uses scope pre declaration technology to optimize the template rendering speed, so as to achieve the running performance close to the JavaScript limit, and supports both NodeJS and browsers.
Document address: https://aui.github.io/art-template/docs/index.html
...
Posted by smpdawg on Tue, 31 Dec 2019 02:38:00 -0800
Use SmartRefreshLayout to complete the complete example of RecyclerView pull-up refresh and pull-down refresh
First, let's take a look at the effect, first update 5 data items from top to bottom, then slide to the bottom and pull up to add 5 data items from the bottom to the top:
We use a third-party library, so we first add it in the gradle configuration file:
implementation 'com.android.support:recyclerview-v7:25.3.1'
imp ...
Posted by paladaxar on Tue, 31 Dec 2019 01:14:42 -0800