使用 Warp 处理并发请求
Handling concurrent requests with Warp
我制作了一个 Wai 网络应用程序,它正在 运行 使用 Warp。但是,我有一个 AJAX 请求需要相当长的时间才能完成,而该请求处于待处理状态,服务器将不会接受其他请求。我认为 Warp 能够处理并发请求。我错过了什么吗?我 运行 Warp 的方法就是调用 run port app
,其中 run
是通过 import Network.Wai.Handler.Warp (run)
导入的,app
是我的 Wai 应用程序。
我正在尝试 Happstack Lite to see whether it would solve my problem, and there the -threaded
flag was used when compiling the web application, which also solved my concurrent requests problem in the Warp application. I was under the assumption that GHC would have threading support by default, but apparently this have to be specified explicitly during compilation。
我制作了一个 Wai 网络应用程序,它正在 运行 使用 Warp。但是,我有一个 AJAX 请求需要相当长的时间才能完成,而该请求处于待处理状态,服务器将不会接受其他请求。我认为 Warp 能够处理并发请求。我错过了什么吗?我 运行 Warp 的方法就是调用 run port app
,其中 run
是通过 import Network.Wai.Handler.Warp (run)
导入的,app
是我的 Wai 应用程序。
我正在尝试 Happstack Lite to see whether it would solve my problem, and there the -threaded
flag was used when compiling the web application, which also solved my concurrent requests problem in the Warp application. I was under the assumption that GHC would have threading support by default, but apparently this have to be specified explicitly during compilation。