Skip to content

Commit e622dd8

Browse files
authored
Merge pull request #18 from jehiah/epsilon_mutex_18
EpsilonGreedy: don't copy standardHostPool which has a sync.Mutex
2 parents 5d3b4dc + cf8eb73 commit e622dd8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

epsilon_greedy.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func (r *epsilonHostPoolResponse) Mark(err error) {
2020
}
2121

2222
type epsilonGreedyHostPool struct {
23-
standardHostPool // TODO - would be nifty if we could embed HostPool and Locker interfaces
23+
*standardHostPool // TODO - would be nifty if we could embed HostPool and Locker interfaces
2424
epsilon float32 // this is our exploration factor
2525
decayDuration time.Duration
2626
EpsilonValueCalculator // embed the epsilonValueCalculator
@@ -49,7 +49,7 @@ func NewEpsilonGreedy(hosts []string, decayDuration time.Duration, calc EpsilonV
4949
}
5050
stdHP := New(hosts).(*standardHostPool)
5151
p := &epsilonGreedyHostPool{
52-
standardHostPool: *stdHP,
52+
standardHostPool: stdHP,
5353
epsilon: float32(initialEpsilon),
5454
decayDuration: decayDuration,
5555
EpsilonValueCalculator: calc,

0 commit comments

Comments
 (0)