The latest release of ErgoFramework 2.2 has been announced, implementing the complete network stack of Erlang and its OTP library in Go. The framework provides developers with a flexible toolbox from the Erlang world for building distributed solutions in Go using general-purpose design patterns such as gen.Application, gen.Supervisor, and gen.Server, as well as specialized ones like gen.Stage (distributed pub/sub), gen.Saga (distributed transactions, implementation of the SAGA design pattern), and gen.Raft (implementation of the Raft protocol).
In addition, the framework offers proxy functionality with end-to-end encryption, unavailable in Erlang/OTP and Elixir. Since Go lacks a direct analog of the Erlang process, the framework uses goroutines as the basis for gen.Server with a 'recover' wrapper to handle exceptional situations. The project code is distributed under the MIT license.
The network stack in ErgoFramework fully implements the DIST protocol specification of Erlang. This means that applications built on ErgoFramework natively communicate with any applications written in Erlang or Elixir programming languages (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 — design pattern for Web API Gateway (also known as Backend For Frontend). Example.
- gen.TCP — a template that allows you to implement a pool of TCP connection accepters with minimal coding effort. Example.
- gen.UDP — similar to the gen.TCP template, but for the UDP protocol. Example.
- New functionality for Events has been introduced, implementing a simple event bus within the node that allows for the creation of event exchange mechanisms (pub/sub) among local processes. Example.
- Support for type registration has been added, allowing automatic serialization/deserialization of messages into native Golang data types. This means there is no longer a need to use etf.TermIntoStruct for each received message. Registered types will be automatically transformed into the specified type, significantly speeding up message exchange performance between distributed nodes.
Source: opennet.ru
