Skip to content

Instantly share code, notes, and snippets.

@claytongentry
Last active May 7, 2017 17:04
Show Gist options
  • Save claytongentry/125368dd854524ad49bade85ae8e1bdc to your computer and use it in GitHub Desktop.
Save claytongentry/125368dd854524ad49bade85ae8e1bdc to your computer and use it in GitHub Desktop.
defmodule Toolex.AMQP.SubscriberBase do
use GenServer
...
def handle_info({:basic_deliver, payload, meta}, state) do
Logger.info "Deliver received for #{state.module}"
try do
payload = Poison.decode!(payload)
apply state.module, :handle, [payload, meta]
AMQP.Basic.ack state.channel, meta.delivery_tag
...
end
...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment