Skip to content

Commit 60feadf

Browse files
committed
Adds Sentinel Coordinator
1 parent ed80355 commit 60feadf

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

sentinel/sentinel_coordinator.go

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// File: sentinel.go
2+
package sentinel
3+
4+
import (
5+
"context"
6+
"sync"
7+
8+
"github.com/rs/zerolog"
9+
)
10+
11+
type SentinelCoordinator struct {
12+
Sentinel *Sentinel
13+
wg *sync.WaitGroup
14+
Ctx context.Context
15+
cancel context.CancelFunc
16+
log zerolog.Logger
17+
}
18+
19+
func NewSentinelCoordinator(log zerolog.Logger) *SentinelCoordinator {
20+
ctx, cancel := context.WithCancel(context.Background())
21+
wg := &sync.WaitGroup{}
22+
s := NewSentinel(SentinelConfig{})
23+
24+
return &SentinelCoordinator{
25+
Sentinel: s,
26+
wg: wg,
27+
Ctx: ctx,
28+
cancel: cancel,
29+
log: log,
30+
}
31+
}

0 commit comments

Comments
 (0)