webbhuset / elm-actor-model / Webbhuset.Component.SystemEvent

System Events


type SystemEvent
    = PIDNotFound Webbhuset.Internal.PID.PID
    | Kill

System Event

PIDNotFound

If your component sends a message to a PID that does not exist anymore you will receive a PIDNotFound event containing the PID of the killed process. This lets you clean up any PID's you stored in your model for example.

Default handling for this event is to do nothing.

Kill

Kill is received when your component is going to be killed. You have the chance to say some last words before dying.

Default handling for Kill is to also kill all the children of the process.

Handling


type alias Handling msgIn =
Webbhuset.Internal.SystemEvent.Handling msgIn

How should events be handeled.

default : Handling msgIn

Use event default handling.

doNothing : Handling msgIn

Don't do anyting.

iWillHandleIt : msgIn -> Handling msgIn

Handle it yourself.

mapHandling : (msg1 -> msg2) -> Handling msg1 -> Handling msg2

Map the Handling type.