AllForOneStrategy 全部重启策略 当一个子 Actor 失败时,重启所有子 Actor
| 118 | // AllForOneStrategy 全部重启策略 |
| 119 | // 当一个子 Actor 失败时,重启所有子 Actor |
| 120 | type AllForOneStrategy struct { |
| 121 | MaxRestarts int |
| 122 | WithinDuration time.Duration |
| 123 | Decider Decider |
| 124 | |
| 125 | mu sync.Mutex |
| 126 | restartWindow []time.Time |
| 127 | } |
| 128 | |
| 129 | // NewAllForOneStrategy 创建全部重启策略 |
| 130 | func NewAllForOneStrategy(maxRestarts int, within time.Duration, decider Decider) *AllForOneStrategy { |
nothing calls this directly
no outgoing calls
no test coverage detected