Skip to content

Commit

Permalink
Put stream processes in hibernate properly
Browse files Browse the repository at this point in the history
  • Loading branch information
lexmag committed Jul 8, 2015
1 parent ecb0942 commit be6bf0d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/hackney_client/hackney_stream.erl
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ maybe_continue(Parent, Owner, Ref, #client{transport=Transport,
{Ref, resume} ->
stream_loop(Parent, Owner, Ref, Client);
{Ref, pause} ->
erlang:hibernate(?MODULE, maybe_continue, [Parent, Owner, Ref,
proc_lib:hibernate(?MODULE, maybe_continue, [Parent, Owner, Ref,
Client]);
{Ref, stop_async, From} ->
hackney_manager:store_state(Client#client{async=false}),
Expand Down Expand Up @@ -134,7 +134,7 @@ maybe_continue(Parent, Owner, Ref, #client{transport=Transport,
error_logger:error_msg("Unexpected message: ~w~n", [Else])
after 5000 ->

erlang:hibernate(?MODULE, maybe_continue, [Parent, Owner, Ref,
proc_lib:hibernate(?MODULE, maybe_continue, [Parent, Owner, Ref,
Client])

end.
Expand Down Expand Up @@ -234,8 +234,7 @@ async_recv(Parent, Owner, Ref,
{Ref, pause} ->
%% make sure that the proces won't be awoken by a tcp msg
Transport:setopts(Sock, [{active, false}]),
%% hibernate
erlang:hibernate(?MODULE, async_recv, [Parent, Owner, Ref,
proc_lib:hibernate(?MODULE, async_recv, [Parent, Owner, Ref,
Client, Buffer]);
{Ref, close} ->
Transport:close(Sock);
Expand Down

0 comments on commit be6bf0d

Please sign in to comment.