A remote procedure call (the request/response pattern).
import Stomp.Proc
import Stomp.Client
type Msg = Click | Response (Result String (List String))
update : Msg -> State -> (State, Cmd Msg)
update msg state =
case msg of
Click ->
state ! [ getStrings ]
Response (Ok strings) ->
...
Response (Err _) ->
...
getStrings : Cmd Msg
getStrings =
Stomp.Proc.init "example.strings"
|> Stomp.Proc.onResponse Response
|> Stomp.Client.call serverConstruct a remote procedure call with the specified command (queue name).
Add a header to the request message.
Add multiple headers to the request message.
Add a payload to the request message.
Set a callback to be triggered when the response message is received.
Set a callback to be triggered when the response message is received and a JSON decoder to be used to decode the message body.
Batch multiple remote procedure calls together.
Return a remote procedure call that does nothing.
Describes a remote procedure call.