System.Internal.Message.SystemMessage addresses actors appMsg
The type of the System Messages
Spawn an Actor and add it to the System's view
spawn SomeActor populateView
Spawn an Actor, add it to the System's view, and assign it an Address
spawn
SomeActor
(\pid ->
batch
[ populateView pid
, populateAddress pid
]
)
spawn : actors -> (System.Internal.PID.PID -> SystemMessage addresses actors appMsg) -> SystemMessage addresses actors appMsg
Spawn an Actor
spawnWithFlags : Json.Encode.Value -> actors -> (System.Internal.PID.PID -> SystemMessage addresses actors appMsg) -> SystemMessage addresses actors appMsg
Spawn an Actor with given flags (as an encoded JSON Value)
populateView : System.Internal.PID.PID -> SystemMessage addresses actors appMsg
Add a PID to the System's view
The System will render views in the order it receives it.
populateAddress : addresses -> System.Internal.PID.PID -> SystemMessage addresses actors appMsg
Add a PID to a given addresses
You can send messages to Addresses just like you can send messages to a PID.
spawnMultiple : List actors -> (List System.Internal.PID.PID -> SystemMessage addresses actors appMsg) -> SystemMessage addresses actors appMsg
Spawn multiple Actors
spawnMultipleWithFlags : List ( actors, Json.Encode.Value ) -> (List System.Internal.PID.PID -> SystemMessage addresses actors appMsg) -> SystemMessage addresses actors appMsg
Spawn multiple Actors with given flags
stop : System.Internal.PID.PID -> SystemMessage addresses actors appMsg
Kill a process
This will trigger the Actors onKill event on which you can decide what to do with this Message.
There is a Default behaviour available that will remove the Process from the System.
removeFromView : System.Internal.PID.PID -> SystemMessage addresses actors appMsg
Remove a PID from the System view
removeFromAddress : addresses -> System.Internal.PID.PID -> SystemMessage addresses actors appMsg
Remove a PID from a given addresses
sendToPid : System.Internal.PID.PID -> appMsg -> SystemMessage addresses actors appMsg
Send a message to a PID.
sendToAddress : addresses -> appMsg -> SystemMessage addresses actors appMsg
Send a message to an addresses.
sendToPidOnAddress : System.Internal.PID.PID -> addresses -> appMsg -> SystemMessage addresses actors appMsg
Send a message to a PID only when it's on the given addresses.
batch : List (SystemMessage addresses actors appMsg) -> SystemMessage addresses actors appMsg
Batch perform a list of messages
spawn MyActorWorker
(\pid ->
batch
[ populateAddress pid
, populateView pid
]
)
noOperation : SystemMessage addresses actors appMsg
Don't do anything
spaw MyActorWorker (always noOperation)
toCmd : msg -> Platform.Cmd.Cmd msg
Converts a generic msg into Cmd.
updateDocumentTitle : String -> SystemMessage addresses actors appMsg
Update the document title
log : System.Internal.Message.LogMessage addresses actors appMsg -> SystemMessage addresses actors appMsg
Log a LogMessage
This will trigger the onLogMessage function you provided while initializing your application.
ignoreLog : System.Internal.Message.LogMessage addresses actors appMsg -> SystemMessage addresses actors appMsg
Convenience function that ignores all logs