View Source Mammoth (mammoth v0.1.0)
Mammoth: A STOMP client.
Use Mammoth
as the primary API and Mammoth.Message
for working with received messages.
example
Example
{:ok, callback_pid} = Mammoth.DefaultCallbackHandler.start_link
{:ok, pid} = Mammoth.start_link(callback_pid)
Mammoth.connect(pid, {127,0,0,1}, 61613, "admin", "admin")
Mammoth.subscribe(pid, "foo.bar")
Mammoth.disconnect(pid)
starting-in-a-supervision-tree
Starting in a supervision tree
children = [
worker(Mammoth, [%{}, [name: Mammoth]])
]
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor.
Connect to server.
Disconnect from server.
Requests disconnection from the remote server
Callback implementation for GenServer.init/1
.
Receive messages from the TCP socket.
Subscribe to a queue.
Unsubscribe from a queue.
Link to this section Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
Connect to server.
host
must be inet:socket_address() | inet:hostname()
, for example {127,0,0,1}
.
Disconnect from server.
Requests disconnection from the remote server
Callback implementation for GenServer.init/1
.
Receive messages from the TCP socket.
Is called automatically when necessary. Should not be called manually.
Subscribe to a queue.
Unsubscribe from a queue.