NewCompositeStrategy 创建组合策略
(fallback SupervisorStrategy)
| 294 | |
| 295 | // NewCompositeStrategy 创建组合策略 |
| 296 | func NewCompositeStrategy(fallback SupervisorStrategy) *CompositeStrategy { |
| 297 | if fallback == nil { |
| 298 | fallback = DefaultSupervisorStrategy() |
| 299 | } |
| 300 | return &CompositeStrategy{ |
| 301 | strategies: make(map[string]SupervisorStrategy), |
| 302 | fallback: fallback, |
| 303 | } |
| 304 | } |
| 305 | |
| 306 | // RegisterStrategy 注册特定错误类型的策略 |
| 307 | func (s *CompositeStrategy) RegisterStrategy(errType string, strategy SupervisorStrategy) { |
nothing calls this directly
no test coverage detected