Module

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 Unit

Stops a monitor started with Monitor.monitor, using erlang:demonitor and subject to the same restrictions/caveats

#MonitorMsg Source

data MonitorMsg

Reference to a monitor, used to stop the monitor once it is started

Constructors

#MonitorType Source

data MonitorType

The type of monitor this message is being sent on behalf

Constructors

#MonitorRef Source

data MonitorRef :: Type

Reference to a monitor, used to stop the monitor once it is started

#MonitorObject Source

type MonitorObject = Foreign

This is probably a Pid, but until it is needed it will be Foreign

#MonitorInfo Source

type MonitorInfo = Foreign

The 'reason' for the monitor being invoked, if this needs unpacking then FFI will need to be written