itk_queue v0.2.9 ITKQueue
Provides convenience functions for subscribing to queues and publishing messages.
Summary
Functions
Publish a message. Expects the message to be something that can be encoded as JSON
Subscribes to a queue
Functions
Publish a message. Expects the message to be something that can be encoded as JSON.
Examples
iex> ITKQueue.publish("data.sync", %{type: "user", data: %{name: "Test User"}})
Subscribes to a queue.
The handler is expected to be a function that handles the message. If the function raises an exception the message will be moved to a temporary queue and retried after a delay.
Examples
iex> ITKQueue.subscribe("students-data-sync", "data.sync", fn(message) -> IO.puts(inspect(message)) end)