Skip to content

ChivenZhang/OpenMS

Repository files navigation

  ___                   __  __ ____  
 / _ \ _ __   ___ _ __ |  \/  / ___| 
| | | | '_ \ / _ \ '_ \| |\/| \___ \ 
| |_| | |_) |  __/ | | | |  | |___) |
 \___/| .__/ \___|_| |_|_|  |_|____/ 
======|_|============================

:: OpenMS :: (v1.0.0)

Description

The Distributed Network Framework based on Microservice Theory.

Features

  • Support reactor network pattern
  • Support tcp, udp, kcp, rpc, http
  • Support c++20 coroutine coding
  • Support Erlang-like message
  • Support IOC collection mechanism
  • Support microservice cluster
  • Support Windows, macOS, Linux
  • Support Hot module replacement

How to install

  • Set the environment variable "VCPKG_ROOT_CUSTOM".
  • Use vcpkg to install dependency on manifest mode.
  • Use CLion or Visual Studio to open folder where contains CMakeLists.txt .
  • See directory ./Sample for more details.
// Master service instance
class Master : public MasterService
{
protected:
	void onInit() override;
	void onExit() override;
};
OPENMS_RUN(Master)

// Apply config in Application.json
// "master": {
//      "server": {
//          "ip": "127.0.0.1",
//          "port": 8080
//      }
// }
// First cluster instance joined to master
class Cluster1 : public ClusterService
{
protected:
	void onInit() override;
	void onExit() override;
};
OPENMS_RUN(Cluster1)
// Second cluster instance joined to master
class Cluster2 : public ClusterService
{
protected:
	void onInit() override;
	void onExit() override;
};
OPENMS_RUN(Cluster2)

Architecture

missing