Module

Pinto.Supervisor.SimpleOneForOne

Package
erl-pinto
Repository
id3as/purescript-erl-pinto

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 Source

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 Source

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

#SupervisorPid Source

newtype SupervisorPid childStartArg childProcess

Instances

#SupervisorType Source

newtype SupervisorType childStartArg childProcess

#startChild Source

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 Source

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 Source

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