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

     1  package cloud
     2  
     3  import (
     4  	"github.com/ergo-services/ergo/etf"
     5  	"github.com/ergo-services/ergo/gen"
     6  )
     7  
     8  type cloudAppSup struct {
     9  	gen.Supervisor
    10  }
    11  
    12  func (cas *cloudAppSup) Init(args ...etf.Term) (gen.SupervisorSpec, error) {
    13  	return gen.SupervisorSpec{
    14  		Children: []gen.SupervisorChildSpec{
    15  			gen.SupervisorChildSpec{
    16  				Name:  "cloud_client",
    17  				Child: &cloudClient{},
    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  }