Create a connection reference. The connection is not set up yet by
this predicate. Callback is called on any received frame except for
heart beat frames as below.
call(Callback, Command, Connection, Header, Body)
Where command is one of the commands below. Header is a dict
holding the STOMP frame header, where all values are strings except
'content-length' key value which is passed as an integer.
Body is a string or, if the data is of the type
application/json, a dict.
- A connection was established. Connection and Header are valid.
- The connection was lost. Only Connection is valid.
- A message arrived. All three arguments are valid. Body is
a dict if the
content-type of the message is
application/json and a string otherwise.
- A heartbeat was received. Only Connection is valid. This
callback is also called for each newline that follows a frame.
These newlines can be a heartbeat, but can also be additional
newlines that follow a frame.
- No heartbeat was received. Only Connection is valid.
- An error happened. All three arguments are valid and handled
Note that stomp_teardown/1 causes the receiving and heartbeat thread
to be signalled with abort/0.
- Try to reestablish the connection to the server if the
connection is lost. Default is
- Maximum time to try and reestablish a connection. The
600 (10 minutes).
- Options passed to json_read_dict/3 to translate
application/json content to Prolog. Default is
|Address||- is a valid address for tcp_connect/3. Normally a term
Host:Port, e.g., |
|Host||- is a path denoting the STOMP host. Often just |
|Headers||- is a dict with STOMP headers used for the |
|Connection||- is an opaque ground term that identifies the