github.com/ergo-services/ergo@v1.999.224/apps/system/sup.go (about)

     1  package system
     2  
     3  import (
     4  	"github.com/ergo-services/ergo/etf"
     5  	"github.com/ergo-services/ergo/gen"
     6  )
     7  
     8  type systemAppSup struct {
     9  	gen.Supervisor
    10  }
    11  
    12  func (sas *systemAppSup) Init(args ...etf.Term) (gen.SupervisorSpec, error) {
    13  	return gen.SupervisorSpec{
    14  		Children: []gen.SupervisorChildSpec{
    15  			gen.SupervisorChildSpec{
    16  				Name:  "system_metrics",
    17  				Child: &systemMetrics{},
    18  				Args:  args,
    19  			},
    20  		},
    21  		Strategy: gen.SupervisorStrategy{
    22  			Type:      gen.SupervisorStrategyOneForOne,
    23  			Intensity: 10,
    24  			Period:    5,
    25  			Restart:   gen.SupervisorStrategyRestartPermanent,
    26  		},
    27  	}, nil
    28  }