An actor-based Framework with network transparency for creating event-driven architecture in Golang. Inspired by Erlang. Zero dependencies.
MIT License
Bot releases are hidden (Show)
This release includes fixes:
gen.SupervisorStrategyRestartTransient
restart strategy in gen.Supervisor
ServerBehavior
in [gen.Pool
, gen.Raft
, gen.Saga
, gen.Stage
, gen.TCP
, gen.UDP
, gen.Web
] behavior interfacesergo
https://github.com/ergo-services/tools. You may read more information about this tool in our article with a great example https://blog.ergo.services/quick-start-1094d56d4e2
Published by halturin over 1 year ago
This release includes fixes:
gen.TCP
. Issue #152Published by halturin over 1 year ago
gen.Pool
. 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. See example here examples/genpool
gen.Server
. So, there is no reason to keep supporting it. Use a regular way of messaging instead - gen.Server
.StartType
option in gen.ApplicationSpec
is ignored for the autostarting applications)Published by halturin over 1 year ago
examples
moved to https://github.com/ergo-services/examples
nil
values for the registered types using etf.RegisterType(...)
ergo.debug
option that enables extended debug information for lib.Log(...)
/lib.Warning(...)
gen.TCP
and gen.UDP
(missing callbacks)etf.Pid
, etf.Alias
or etf.Ref
value typesPublished by halturin about 2 years ago
gen.Web
behavior. It implements Web API Gateway pattern is also sometimes known as the "Backend For Frontend" (BFF). See example examples/genweb
gen.TCP
behavior - socket acceptor pool for TCP protocols. It provides everything you need to accept TCP connections and process packets with a small code base and low latency. Here is simple example examples/gentcp
gen.UDP
- the same as gen.TCP
, but for UDP protocols. Example is here examples/genudp
gen.Process
can become a producer by registering a new event gen.Event
using method gen.Process.RegisterEvent
, while the others can subscribe to these events using gen.Process.MonitorEvent
. Subscriber process will also receive gen.MessageEventDown
if a producer process went down (terminated). This feature behaves in a monitor manner but only works within a node. You may also want to subscribe to a system event - node.EventNetwork
to receive event notification on connect/disconnect any peers.etf.TermIntoStruct
for the receiving messages. Register your type using etf.RegisterType(...)
, and you will be receiving messages in a native typelib
packagegen.ServerBehavior.HandleDirect
method (got extra argument etf.Ref
to distinguish the requests). This change allows you to handle these requests asynchronously using method gen.ServerProcess.Reply(...)
node.Options
. Now it has field Listeners
(type node.Listener
). It allows you to start any number of listeners with custom options - Port
, TLS
settings, or custom Handshake
/Proto
interfacesgen.ProcessOptions.Context
handlingPublished by halturin over 2 years ago
This release includes fixes:
Published by halturin over 2 years ago
gen.Process
:
SetCompression(enable bool)
, Compression() bool
SetCompressionLevel(level int)
, CompressionLevel() int
SetCompressionThreshold(threshold int)
, CompressionThreshold() int
messages smaller than the threshold will be sent with no compression. The default compression threshold is 1024 bytes.node.Options
:
Compression
these settings are used as defaults for the spawning processesnode.Node
new methods:
AddProxyRoute(...)
, RemoveProxyRoute(...)
ProxyRoute(...)
, ProxyRoutes()
NodesIndirect()
returns list of connected nodes via proxy connectionnode.Options
:
Proxy
for configuring proxy settingsgen.Raft
. 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. Here is an example of this feature examples/raft.Resolver
to replace EPMD routines with your solution (e.g., ZooKeeper or any other service registrar)Handshake
allows customizing authorization/authentication processProto
provides the way to implement proprietary protocols (e.g., for IoT area)gen.Process
new methods:
NodeUptime()
, NodeName()
, NodeStop()
gen.ServerProcess
new method:
MessageCounter()
shows how many messages have been handled by the gen.Server
callbacksgen.ProcessOptions
new option:
ProcessFallback
allows forward messages to the fallback process if the process mailbox is full. Forwarded messages are wrapped into gen.MessageFallback
struct. Related to issue #96.gen.SupervisorChildSpec
and gen.ApplicationChildSpec
got option gen.ProcessOptions
to customize options for the spawning child processes.gen.Process.Send
, gen.ServerProcess.Cast
, gen.ServerProcess.Call
now return node.ErrProcessIncarnation
if a message is sending to the remote process of the previous incarnation (remote node has been restarted).gen.EnvKey
for the environment variablesnode.EnvKeyNode
variable to get access to the node.Node
value.node.Options
has changed. Make sure to adjust your code.Published by halturin almost 3 years ago
This release includes fixes:
Published by halturin almost 3 years ago
This release has a minor fix
Published by halturin about 3 years ago
We have to make another release of v2.0.0 due to https://go.dev/blog/v2-go-modules. More details here https://github.com/ergo-services/ergo#versioning
gen.Saga
. 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). Here is example examples/gensaga.Process.Direct
and Process.DirectWithTimeout
to make direct request to the actor (gen.Server
or inherited object). If an actor has no implementation of HandleDirect
callback it returns ErrUnsupportedRequest
as a error.HandleDirect
in the gen.Server
interface as a handler for requests made by Process.Direct
or Process.DirectWithTimeout
. It should be easy to interact with actors from outside.etf.ListImproper
to support improper lists like [a|b]
(a cons cell).etf.String
(an alias for the Golang string) encodes as a binary in order to support Elixir string type (which is binary()
type)etf.Charlist
(an alias for the Golang string) encodes as a list of chars []rune
in order to support Erlang string type (which is charlist()
type)Node.ProvideRemoteSpawn
, Node.RevokeRemoteSpawn
, Process.RemoteSpawn
.Marshaler
(method MarshalETF
) and Unmarshaler
(method UnmarshalETF
) for the custom encoding/decoding data.gen.Server
. Take inspiration from the gen/stage.go or gen/saga.go design patterns.Published by halturin about 3 years ago
This release includes hot fixes
Published by halturin about 3 years ago
This release includes hotfixes
Published by halturin over 3 years ago
This release includes hotfixes
Published by halturin over 3 years ago
Published by halturin over 3 years ago
This release is the hot fix of this issue https://github.com/halturin/ergo/issues/45
Published by halturin over 3 years ago
Hot fix release
Published by halturin over 3 years ago
Introduced TLS support, GenStage behavior, static route, and a lot of fixes. More details in README.md/ChangeLog.md
Published by halturin over 4 years ago
Fragmentation support and significant performance improvements
Published by halturin over 4 years ago
The new release delivers a bunch of new features. See ChangeLog.md for the details
Published by halturin about 5 years ago