func (s *Module) RemoveCallBack(id string) {
	s.lock.Lock()
	defer s.lock.Unlock()
	delete(s.cbs, id)
}
RemoveCallBack removes a call back function
package leader
import (
	"context"
	"sync"
	"time"
	"github.com/spaceuptech/helpers"
	"github.com/spaceuptech/space-cloud/gateway/utils/pubsub"
)
var leaderElectionRedisKey = "license-manager"
const leaderTime = 10 * time.Second  
type Module struct {
	lock sync.RWMutex
	pubsubClient *pubsub.Module
	nodeID       string
	cbs          map[string]func()
}
func New(nodeID string, module *pubsub.Module) *Module {
	m := &Module{pubsubClient: module, nodeID: nodeID, cbs: map[string]func(){}}
	go m.applyForLeaderPosition()
	go m.renewYourLeaderPosition()
	return m
}
func (s *Module) AddCallBack(id string, cb func()) {
	s.lock.Lock()
	defer s.lock.Unlock()
	s.cbs[id] = cb
}