diff --git a/README.md b/README.md index 22242f4..d24f5c1 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # steward Async management of Edge Cloud units. + The idea is to build and use a pure message passing architecture for the control traffic back and forth from the Edge cloud units. The message passing backend used is ```text @@ -23,6 +24,15 @@ The idea is to build and use a pure message passing architecture for the control │ │ └─────────────────┘ ``` +Why ? + +With existing solutions there is often either a push or a pull kind of setup. + +In a push setup the commands to execute is pushed to the receiver, but if a command fails because for example a broken network link it is up to you as an administrator to detect those failures and retry them at a later time until it is executed successfully. + +In a pull setup an agent is installed at the Edge unit, and the configuration or commands to execute locally are pulled from a central repository. With this kind of setup you can be pretty certain that sometime in the future the Edge unit will reach it's desired state, but you don't know when. And if you want to know the current state you will need to have some second service which gives you that. + +In it's simplest form the idea about using an event driven system as the core for management of Edge units is that the sender/publisher are fully decoupled from the receiver/subscriber. We can get an acknowledge if a message is received or not, and with this functionality we will at all times know the current state of the receiving end. We can also add information in the ACK message if the command sent to the receiver was successful or not by appending the actual output of the command. ## Disclaimer diff --git a/publisher.go b/publisher.go index 7fdc854..259909c 100644 --- a/publisher.go +++ b/publisher.go @@ -173,7 +173,7 @@ type process struct { // prepareNewProcess will set the the provided values and the default // values for a process. func (s *server) prepareNewProcess(subject subject) process { - // create the initial configuration for a sessions communicating with 1 host. + // create the initial configuration for a sessions communicating with 1 host process. s.lastProcessID++ proc := process{ messageID: 0, diff --git a/subscriber.go b/subscriber.go index 56d5f1e..3054d38 100644 --- a/subscriber.go +++ b/subscriber.go @@ -10,6 +10,9 @@ import ( "github.com/nats-io/nats.go" ) +// RunSubscriber will start a subscribing process. +// TODO: Right now the only thing a subscriber can do is ro receive commands, +// check if there are more things a subscriber should be able to do. func (s *server) RunSubscriber() { // Create a channel to put the data received in the subscriber callback