Pinto.Monitor
- Package
- erl-pinto
- Repository
- id3as/purescript-erl-pinto
This module wraps erlang:monitor in Pinto.MessageRouting so that sensible message structures can be sent
back to the monitoring process
#monitor Source
monitor :: forall msg process m. HasPid process => MonadEffect m => HasSelf m msg => process -> (MonitorMsg -> msg) -> m (RouterRef MonitorRef)Given something that has a pid (A GenServer, a Process.. or just a Pid), attach a monitor by using
erlang:monitor on the underlying pid, a message will be sent to the current process, lifted into the
constructor f provided
#monitorTo Source
monitorTo :: forall msg process target. HasPid process => HasProcess msg target => process -> target -> (MonitorMsg -> msg) -> Effect (RouterRef MonitorRef)Given something that has a pid (A GenServer, a Process.. or just a Pid), attach a monitor by using
erlang:monitor on the underlying pid, a message will be sent to the current process, lifted into the
constructor f provided
#demonitor Source
demonitor :: RouterRef MonitorRef -> Effect UnitStops a monitor started with Monitor.monitor, using erlang:demonitor and subject to the same restrictions/caveats
#MonitorMsg Source
#MonitorRef Source
data MonitorRef :: TypeReference to a monitor, used to stop the monitor once it is started
#MonitorObject Source
type MonitorObject = ForeignThis is probably a Pid, but until it is needed it will be Foreign
#MonitorInfo Source
type MonitorInfo = ForeignThe 'reason' for the monitor being invoked, if this needs unpacking then FFI will need to be written