ergo/gen
Taras Halturin 2e85c20042
Fix incorrect handling of gen.SupervisorStrategyRestartTransient restart strategy
2023-04-25 12:22:38 +02:00
..
README.md V222 (#145) 2023-03-01 10:41:02 +01:00
application.go V222 (#145) 2023-03-01 10:41:02 +01:00
pool.go Fix missing ServerBehavior in [Pool,Raft,Saga,Stage,TCP,UDP,Web]Behavior interfaces 2023-04-07 09:10:30 +02:00
pool_worker.go V222 (#145) 2023-03-01 10:41:02 +01:00
raft.go Fix missing ServerBehavior in [Pool,Raft,Saga,Stage,TCP,UDP,Web]Behavior interfaces 2023-04-07 09:10:30 +02:00
saga.go Fix missing ServerBehavior in [Pool,Raft,Saga,Stage,TCP,UDP,Web]Behavior interfaces 2023-04-07 09:10:30 +02:00
saga_worker.go V220 (#110) 2022-10-18 08:24:40 +02:00
server.go V222 (#145) 2023-03-01 10:41:02 +01:00
stage.go Fix missing ServerBehavior in [Pool,Raft,Saga,Stage,TCP,UDP,Web]Behavior interfaces 2023-04-07 09:10:30 +02:00
stage_dispatcher.go V221 (#138) 2023-02-01 10:37:49 +01:00
supervisor.go Fix incorrect handling of gen.SupervisorStrategyRestartTransient restart strategy 2023-04-25 12:22:38 +02:00
tcp.go Fix missing ServerBehavior in [Pool,Raft,Saga,Stage,TCP,UDP,Web]Behavior interfaces 2023-04-07 09:10:30 +02:00
tcp_handler.go V220 (#110) 2022-10-18 08:24:40 +02:00
types.go V222 (#145) 2023-03-01 10:41:02 +01:00
udp.go Fix missing ServerBehavior in [Pool,Raft,Saga,Stage,TCP,UDP,Web]Behavior interfaces 2023-04-07 09:10:30 +02:00
udp_handler.go V220 (#110) 2022-10-18 08:24:40 +02:00
web.go Fix missing ServerBehavior in [Pool,Raft,Saga,Stage,TCP,UDP,Web]Behavior interfaces 2023-04-07 09:10:30 +02:00
web_handler.go V220 (#110) 2022-10-18 08:24:40 +02:00

README.md

Generic behaviors

Server

Generic server behavior.

Example: gen.Server

Supervisor

Generic supervisor behavior.

A supervisor is responsible for starting, stopping, and monitoring its child processes. The basic idea of a supervisor is that it is to keep its child processes alive by restarting them when necessary.

Example: gen.Supervisor

Application

Generic application behavior.

Example: gen.Application

Pool

Generic pool of workers.

This behavior implements a basic design pattern with a pool of workers. All messages/requests received by the pool process are forwarded to the workers using the "Round Robin" algorithm. The worker process is automatically restarting on termination.

Example: gen.Pool

Web

Web API Gateway behavior.

The Web API Gateway pattern is also sometimes known as the "Backend For Frontend" (BFF) because you build it while thinking about the needs of the client app. Therefore, BFF sits between the client apps and the microservices. It acts as a reverse proxy, routing requests from clients to services.

Example: gen.Web

TCP

Socket acceptor pool for TCP protocols.

This behavior aims to provide everything you need to accept TCP connections and process packets with a small code base and low latency while being easy to use.

Example: gen.TCP

UDP

UDP acceptor pool for UDP protocols

This behavior provides the same feature set as TCP but for handling UDP packets using pool of handlers.

Example: gen.UDP

Stage

Generic stage behavior (originated from Elixir's GenStage).

This is abstraction built on top of gen.Server to provide a simple way to create a distributed Producer/Consumer architecture, while automatically managing the concept of backpressure. This implementation is fully compatible with Elixir's GenStage.

Example: gen.Stage

Saga

Generic saga behavior.

It implements Saga design pattern - a sequence of transactions that updates each service state and publishes the result (or cancels the transaction or triggers the next transaction step). gen.Saga also provides a feature of interim results (can be used as transaction progress or as a part of pipeline processing), time deadline (to limit transaction lifespan), two-phase commit (to make distributed transaction atomic).

Example: gen.Saga

Raft

Generic raft behavior.

It's improved implementation of Raft consensus algorithm. The key improvement is using quorum under the hood to manage the leader election process and make the Raft cluster more reliable. This implementation supports quorums of 3, 5, 7, 9, or 11 quorum members.

Example: gen.Raft