This is a piece of code inside of a GenServer implementation, and this call is a async call(which it returns a no_reply at handle_call block), I would like it to return me back a :no_reply value after the timeout, but it indeed keep crashes my process.
def call(exchange,routing_key,content) do
try do
:gen_server.call(__MODULE__,{:call,{exchange,routing_key,content}},1000)
rescue
e ->
IO.puts "get #{inspect e}"
:no_reply
end
end
here is a snapshot I'm working with AMQP queue, I would expect after the timeout it should yield me back :noreply, and here is the crash info.
** (exit) exited in: :gen_server.call(MessageDispatcher, {:call, {"Event", "NewMessage", "test"}}, 1000)
** (EXIT) time out
(stdlib) gen_server.erl:190: :gen_server.call/3
(generic_gateway) lib/wechat_message_callback/msg/msg_callback.ex:24: MessageDispatcher.call/3
iex(4)>