1
0
Fork 0
mirror of https://github.com/postmannen/ctrl.git synced 2024-12-14 12:37:31 +00:00

updated doc

This commit is contained in:
postmannen 2021-02-03 09:06:37 +01:00
parent d6d77e6b02
commit 41ced11b59
3 changed files with 14 additions and 1 deletions

View file

@ -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 <https://nats.io>
```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

View file

@ -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,

View file

@ -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