Pattern 2 Master server making heartbeat requests to the slave servers to check if they are alive
package main
import (
"fmt"
"sync"
"time"
)
type Master struct {
slaves []*Slave
shutdown bool
mu sync.Mutex
}
type Slave struct {
ID string
Alive bool
}
func (m *Master) checkSlaveHealth(slave *Slave) {...
hey-there.hashnode.dev2 min read