on master help sign in
changing the names of APIs (suggested by @alexanderkjeldaas).
9be26ffKazu Yamamoto
warp/Network/Wai/Handler/Warp/HTTP2.hs+1−1
@@ -34,7 +34,7 @@ http2 conn ii addr transport settings readN app = do
34 action = worker ctx settings tm app responder
34 action = worker ctx settings tm app responder
35 setAction mgr action
35 setAction mgr action
36 -- fixme: hard coding: 10
36 -- fixme: hard coding: 10
37− replicateM_ 10 $ spawn mgr
37+ replicateM_ 10 $ spawnAction mgr
38 -- Receiver
38 -- Receiver
39 let mkreq = mkRequest settings addr
39 let mkreq = mkRequest settings addr
40 tid <- forkIO $ frameReceiver ctx mkreq readN
40 tid <- forkIO $ frameReceiver ctx mkreq readN
warp/Network/Wai/Handler/Warp/HTTP2/Manager.hs+9−9
@@ -1,12 +1,12 @@
1{-# LANGUAGE CPP #-}
1{-# LANGUAGE CPP #-}
2
2
3module Network.Wai.Handler.Warp.HTTP2.Manager (
3module Network.Wai.Handler.Warp.HTTP2.Manager (
4+ Manager
4− start
5+ , start
5− , stop
6− , spawn
7− , replace
8 , setAction
6 , setAction
9− , Manager
7+ , stop
8+ , spawnAction
9+ , replaceWithAction
10 ) where
10 ) where
11
11
12#if __GLASGOW_HASKELL__ < 709
12#if __GLASGOW_HASKELL__ < 709
@@ -57,11 +57,11 @@ setAction (Manager _ ref) action = writeIORef ref action
57stop :: Manager -> IO ()
57stop :: Manager -> IO ()
58stop (Manager q _) = atomically $ writeTQueue q Stop
58stop (Manager q _) = atomically $ writeTQueue q Stop
59
59
60−spawn :: Manager -> IO ()
60+spawnAction :: Manager -> IO ()
61−spawn (Manager q _) = atomically $ writeTQueue q Spawn
61+spawnAction (Manager q _) = atomically $ writeTQueue q Spawn
62
62
63−replace :: Manager -> ThreadId -> IO ()
63+replaceWithAction :: Manager -> ThreadId -> IO ()
64−replace (Manager q _) tid = atomically $ writeTQueue q $ Replace tid
64+replaceWithAction (Manager q _) tid = atomically $ writeTQueue q $ Replace tid
65
65
66----------------------------------------------------------------
66----------------------------------------------------------------
67
67
warp/Network/Wai/Handler/Warp/HTTP2/Worker.hs+1−1
@@ -44,7 +44,7 @@ response Context{outputQ} mgr tconf th strm pri req rsp = do
44 -- So, this work occupies this thread.
44 -- So, this work occupies this thread.
45 --
45 --
46 -- We need to increase the number of workers.
46 -- We need to increase the number of workers.
47− myThreadId >>= replace mgr
47+ myThreadId >>= replaceWithAction mgr
48 -- After this work, this thread stops to decease
48 -- After this work, this thread stops to decease
49 -- the number of workers.
49 -- the number of workers.
50 setThreadContinue tconf False
50 setThreadContinue tconf False