mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 12:20:24 +00:00
Add timeout to cowboy_loop
LH: I have added a test that does both hibernate and timeout and fixed a related issue. I also tweaked the docs and tests.
This commit is contained in:
parent
a72bf4105f
commit
a81dc8af9d
8 changed files with 165 additions and 25 deletions
|
@ -659,7 +659,7 @@ sys_get_state_loop(Config) ->
|
|||
timer:sleep(100),
|
||||
SupPid = get_remote_pid_tcp(Socket),
|
||||
[{_, Pid, _, _}] = supervisor:which_children(SupPid),
|
||||
{Req, Env, long_polling_sys_h, undefined} = sys:get_state(Pid),
|
||||
{Req, Env, long_polling_sys_h, undefined, infinity} = sys:get_state(Pid),
|
||||
#{pid := _, streamid := _} = Req,
|
||||
#{dispatch := _} = Env,
|
||||
ok.
|
||||
|
@ -784,7 +784,7 @@ sys_replace_state_loop(Config) ->
|
|||
timer:sleep(100),
|
||||
SupPid = get_remote_pid_tcp(Socket),
|
||||
[{_, Pid, _, _}] = supervisor:which_children(SupPid),
|
||||
{Req, Env, long_polling_sys_h, undefined} = sys:replace_state(Pid, fun(S) -> S end),
|
||||
{Req, Env, long_polling_sys_h, undefined, infinity} = sys:replace_state(Pid, fun(S) -> S end),
|
||||
#{pid := _, streamid := _} = Req,
|
||||
#{dispatch := _} = Env,
|
||||
ok.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue