Last active
May 7, 2017 17:04
-
-
Save claytongentry/125368dd854524ad49bade85ae8e1bdc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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