In order to reduce the duplication of work and facilitate the management of code, i integrated the common components in a single git repository which servers as a git submodule for all the servers mentioned above.
Because these components were coupled with my business layer code, so i had to decouple them and retest the decoupled components, and those tests were certainly not as good as that the online product went through, so welcome to report me the issues and i will solve them as soon as possible.
There are glance of these common components:
- app: more minimalist web framework that refer to lor.
- flowCtrl: control the workflow of your code (parallel, parallelRace, parallelPro and so on).
- log: unify and standardize the log system.
- net: wrap a simple network communication (TCP, HTTP and so on).
- scheduler: sidecar like, expected to be the unified scheduling layer for some common components (net, storage and so on).
- storage: wrap a simple storage (redis, rediscluster and so on).
- toolkit: common utils (auto require, dump table, json encode/decode an so on).
- wrapper: wrapper for advanced features (tracer and so on).
It's recommended to define your own public component directory structure like other components here (where both the scheduler and the toolkit are special).
A simple APIServer was served as an APIServer demo.
A simple TCPServer was served as a TCPServer demo.
- more common components will be implemented later (app was in the plan).
- performance optimization: follow performance guide and avoid NYI.