[99s-extend] Cowboy handler and custom gen_server link
Max Grigoriev
darkit at gmail.com
Wed Jun 5 21:50:25 CEST 2013
Hi,
I'm trying to implement REST handler which communicates to custom
gen_servers.
Get gen_server from supervisor and link to current handler process:
rest_init(Req, _Opts) ->
...
process_flag(trap_exit, true),
{ok, Pid} = pbshare_logic_sup:start_registration(),
link(Pid),
...
make_get(Req, State) ->
....
make error here !!!
....
And gen_server code:
start_link() ->
gen_server:start_link(?MODULE, [], []).
init(Args) ->
process_flag(trap_exit, true),
{ok, []}.
handle_info({'EXIT', FromPid, Reason}, State) ->
lager:info("Exit Logic from ~p Reason: ~p~n", [FromPid, Reason]),
{noreply, State};
So I expect to receive EXIT signal from REST handler to my gen_server when
error occurs in cowboy.
But I don't receive it. Am I doing something wrong?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ninenines.eu/archives/extend/attachments/20130605/568478c8/attachment.html>
More information about the Extend
mailing list