Documentation
¶
Index ¶
- func StartDefaultLink(self erl.PID, children []ChildSpec, supFlags SupFlagsS, optFuns ...LinkOpts) (erl.PID, error)
- func StartLink(self erl.PID, callback Supervisor, args any, optFuns ...LinkOpts) (erl.PID, error)
- type ChildSpec
- type ChildSpecOpt
- type ChildType
- type InitResult
- type LinkOpts
- type Restart
- type ShutdownOpt
- type StartFunSpec
- type Strategy
- type SupFlag
- type SupFlagsS
- type Supervisor
- type SupervisorS
- func (s SupervisorS) HandleCall(self erl.PID, request any, from genserver.From, state supervisorState) (genserver.CallResult[supervisorState], error)
- func (s SupervisorS) HandleCast(self erl.PID, arg any, state supervisorState) (genserver.CastResult[supervisorState], error)
- func (s SupervisorS) HandleContinue(self erl.PID, continuation any, state supervisorState) (supervisorState, any, error)
- func (s SupervisorS) HandleInfo(self erl.PID, request any, state supervisorState) (genserver.InfoResult[supervisorState], error)
- func (s SupervisorS) Init(self erl.PID, args any) (genserver.InitResult[supervisorState], error)
- func (s SupervisorS) Terminate(self erl.PID, arg error, state supervisorState)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ChildSpec ¶
type ChildSpec struct { // used to identify the child process internally by the Supervisor ID string // error's of type exitreason.S are special, such as [exitreason.Ignore]. The function must link the process // to the supervisor Start StartFunSpec Restart Restart Shutdown ShutdownOpt Type ChildType // contains filtered or unexported fields }
func NewChildSpec ¶
func NewChildSpec(id string, start StartFunSpec, opts ...ChildSpecOpt) ChildSpec
func NewTestServerChildSpec ¶ added in v0.7.0
func NewTestServerChildSpec[STATE any](id string, ts genserver.TestServer[STATE], gsOpts genserver.StartOpts, opts ...ChildSpecOpt) ChildSpec
type ChildSpecOpt ¶
func SetChildType ¶
func SetChildType(t ChildType) ChildSpecOpt
func SetRestart ¶
func SetRestart(restart Restart) ChildSpecOpt
func SetShutdown ¶
func SetShutdown(shutdown ShutdownOpt) ChildSpecOpt
type InitResult ¶
type SupFlagsS ¶
type SupFlagsS struct { Strategy Strategy // duration of the evaluation window for restarts, in seconds Period int // how many restarts allowed within [Period] Intensity int }
func NewSupFlags ¶
type Supervisor ¶
type Supervisor interface {
Init(self erl.PID, args any) InitResult
}
type SupervisorS ¶
type SupervisorS struct {
// contains filtered or unexported fields
}
Impelements genserver.GenServer and accepts the callback module for Supervisor
func (SupervisorS) HandleCall ¶
func (s SupervisorS) HandleCall(self erl.PID, request any, from genserver.From, state supervisorState) (genserver.CallResult[supervisorState], error)
func (SupervisorS) HandleCast ¶
func (s SupervisorS) HandleCast(self erl.PID, arg any, state supervisorState) (genserver.CastResult[supervisorState], error)
func (SupervisorS) HandleContinue ¶
func (SupervisorS) HandleInfo ¶
func (s SupervisorS) HandleInfo(self erl.PID, request any, state supervisorState) (genserver.InfoResult[supervisorState], error)
func (SupervisorS) Init ¶
func (s SupervisorS) Init(self erl.PID, args any) (genserver.InitResult[supervisorState], error)
Click to show internal directories.
Click to hide internal directories.