Module

Pinto.Supervisor.SimpleOneForOne

This module represents a simple_one_for_one supervisor in OTP It is a special case because if it has different return values and arguments for pretty much every function See also gen_supervisor in the OTP docs (https://erlang.org/doc/man/supervisor.html#)

#ChildSpec

type ChildSpec childStartArg childProcess = { childType :: ChildType, intensity :: Int, period :: Seconds, restartStrategy :: RestartStrategy, shutdownStrategy :: ChildShutdownTimeoutStrategy, start :: childStartArg -> Effect (StartLinkResult childProcess) }

The specification of the dynamic child process, this maps to ChildSpec in the underlying supervisor API with the difference that none of them are optional childStartArg is the parameter expected by the start function for the child. It is provided here childProcess is the typed pid of the started process (commonly GenServer.ServerPid)

#SupervisorRef

type SupervisorRef childStartArg childProcess = RegistryReference (SupervisorPid childStartArg childProcess) (SupervisorType childStartArg childProcess)

#SupervisorPid

newtype SupervisorPid childStartArg childProcess

Instances

#SupervisorType

newtype SupervisorType childStartArg childProcess

#startChild

startChild :: forall childStartArg childProcess. HasPid childProcess => SupervisorRef childStartArg childProcess -> childStartArg -> Effect (StartChildResult childProcess)

Starts a child within th one_for_one supervisor referred to by SupervisorRef childStartArg childProcess See also supervisor:start_child in the OTP documentation

#terminateChild

terminateChild :: forall childStartArg childProcess. SupervisorRef childStartArg childProcess -> childProcess -> Effect TerminateChildResult

Terminates a child within the one_for_one supervisor referred to by SupervisorRef childStartArg childProcess See also supervisor:terminate_child in the OTP documentation

#deleteChild

deleteChild :: forall childStartArg childProcess. SupervisorRef childStartArg childProcess -> childProcess -> Effect DeleteChildResult

Deletes a child within the one_for_one supervisor referred to by SupervisorRef childStartArg childProcess See also supervisor:deleted_child in the OTP documentation

Modules