Release of the ErgoFramework 2.2 framework for creating network applications

The next release of ErgoFramework 2.2 has taken place, which implements the complete Erlang network stack and its OTP library in the Go language. The framework provides the developer with a flexible toolkit from the world of Erlang for creating distributed solutions in the Go language using ready-made general-purpose design patterns gen.Application, gen.Supervisor and gen.Server, as well as specialized ones - gen.Stage (distributed pub/sub), gen. Saga (distributed transactions, an implementation of the SAGA design pattern) and gen.Raft (an implementation of the Raft protocol).

In addition, the framework provides proxy functionality with end-to-end encryption not available in Erlang/OTP and Elixir. Since the Go language does not have a direct analogue of the Erlang process, the framework uses goroutines as the basis for gen.Server with a “recover” wrapper to be able to handle exceptions. The project code is distributed under the MIT license.

The network stack in ErgoFramework fully implements the DIST specification of the Erlang protocol. This means that applications written on the basis of ErgoFramework work natively with any applications written in the Erlang or Elixir programming languages ​​(an example of interaction with an Erlang node). It is also worth noting that the gen.Stage design pattern is implemented according to the Elixir GenStage specification and is fully compatible with it (implementation example).

In the new release:

  • New templates added
    • gen.Web is the Web API Gateway design pattern (also known as Backend For Frontend). Example.
    • gen.TCP is a template that allows you to implement a TCP connection acceptor pool with minimal coding effort. Example.
    • gen.UDP - Similar to the gen.TCP template, but for the UDP protocol. Example.
  • A new Events functionality has been proposed with the implementation of a simple event bus inside the node, which allows you to create event exchange mechanisms (pub / sub) among local processes. Example.
  • Added support for type registration, which allows you to automatically serialize / deserialize messages to a native Golang data type. This means you no longer need to use etf.TermIntoStruct for every message received. Registered types will be converted to the specified type automatically, which greatly speeds up the performance of messaging between distributed nodes.

Source: opennet.ru

Add a comment