github.com/asynkron/protoactor-go@v0.0.0-20240308120642-ef91a6abee75/actor/strategy_restarting.go (about) 1 package actor 2 3 func NewRestartingStrategy() SupervisorStrategy { 4 return &restartingStrategy{} 5 } 6 7 type restartingStrategy struct{} 8 9 var _ SupervisorStrategy = &restartingStrategy{} 10 11 func (strategy *restartingStrategy) HandleFailure(actorSystem *ActorSystem, supervisor Supervisor, child *PID, _ *RestartStatistics, reason interface{}, _ interface{}) { 12 // always restart 13 logFailure(actorSystem, child, reason, RestartDirective) 14 supervisor.RestartChildren(child) 15 }