implement GroupPolicy of GroupPolicyHandler
This commit is contained in:
parent
8f73a779a8
commit
2066723e71
|
@ -18,6 +18,11 @@ type GroupPolicy interface {
|
||||||
// GroupPolicyHandler should be used when a function is a GroupPolicy
|
// GroupPolicyHandler should be used when a function is a GroupPolicy
|
||||||
type GroupPolicyHandler func(*EngineGroup) *Engine
|
type GroupPolicyHandler func(*EngineGroup) *Engine
|
||||||
|
|
||||||
|
// Slave implements the chosen of slaves
|
||||||
|
func (h GroupPolicyHandler) Slave(eg *EngineGroup) *Engine {
|
||||||
|
return h(eg)
|
||||||
|
}
|
||||||
|
|
||||||
// RandomPolicy implmentes randomly chose the slave of slaves
|
// RandomPolicy implmentes randomly chose the slave of slaves
|
||||||
type RandomPolicy struct {
|
type RandomPolicy struct {
|
||||||
r *rand.Rand
|
r *rand.Rand
|
||||||
|
|
Loading…
Reference in New Issue