{"action":"created","issue":{"url":"https://api.github.com/repos/yesodweb/wai/issues/399","labels_url":"https://api.github.com/repos/yesodweb/wai/issues/399/labels{/name}","comments_url":"https://api.github.com/repos/yesodweb/wai/issues/399/comments","events_url":"https://api.github.com/repos/yesodweb/wai/issues/399/events","html_url":"https://github.com/yesodweb/wai/pull/399","id":94888594,"number":399,"title":"supporting HTTP/2.","user":{"login":"kazu-yamamoto","id":165387,"avatar_url":"https://avatars.githubusercontent.com/u/165387?v=3","gravatar_id":"","url":"https://api.github.com/users/kazu-yamamoto","html_url":"https://github.com/kazu-yamamoto","followers_url":"https://api.github.com/users/kazu-yamamoto/followers","following_url":"https://api.github.com/users/kazu-yamamoto/following{/other_user}","gists_url":"https://api.github.com/users/kazu-yamamoto/gists{/gist_id}","starred_url":"https://api.github.com/users/kazu-yamamoto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kazu-yamamoto/subscriptions","organizations_url":"https://api.github.com/users/kazu-yamamoto/orgs","repos_url":"https://api.github.com/users/kazu-yamamoto/repos","events_url":"https://api.github.com/users/kazu-yamamoto/events{/privacy}","received_events_url":"https://api.github.com/users/kazu-yamamoto/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/yesodweb/wai/labels/in%20progress","name":"in progress","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-07-14T07:56:08Z","updated_at":"2015-07-15T00:17:40Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/yesodweb/wai/pulls/399","html_url":"https://github.com/yesodweb/wai/pull/399","diff_url":"https://github.com/yesodweb/wai/pull/399.diff","patch_url":"https://github.com/yesodweb/wai/pull/399.patch"},"body":"This patch implements HTTP/2 ([RFC 7540](https://tools.ietf.org/html/rfc7540)). \r\n\r\nThis code passes the following three tests:\r\n\r\n-- All test cases provided by [h2spec](https://github.com/summerwind/h2spec)\r\n-- Test cases provided by [nghttp](https://nghttp2.org/documentation/nghttp.1.html)\r\n-- Field test in the real web world\r\n\r\nRecent Firefox and Chrome supports HTTP/2 over TLS. With this patch, WarpTLS automatically communicates with Firefox and Chrome in HTTP/2. There is no settings to disable HTTP/2 at this moment. We should implement them if necessary.\r\n\r\nThe following picture illustrates rough architecture:\r\n\r\n```\r\n\r\n         Input queue                          Output queue\r\nReceiver ----------> Thread pool for WAI apps -----------> Sender\r\n```\r\n\r\nIn HTTP/2, multiple streams are asynchronously sent over a TCP connection.\r\n\r\n- The receiver receives HTTP/2 frames, decodes them and enqueues WAI requests to the input queue. The logic of the input buffer is highly tuned.\r\n- A worker thread in the thread pool dequeues a WAI request, gives it to a WAI application, takes its response and enqueues the response to the output priority queue.\r\n- The sender packs a response in the output buffer and send it.\r\n\r\nOne concern: the number of worker threads in the worker pool is now hard coded -- 10. Unlike ResponseFile and ResponseBuilder, ResponseStream occupies the worker thread. So, if 10 streamings are served, no worker is available. We should fix this if necessary.\r\n\r\n@snoyberg Please review and merge this if you think OK.\r\n"},"comment":{"url":"https://api.github.com/repos/yesodweb/wai/issues/comments/121433601","html_url":"https://github.com/yesodweb/wai/pull/399#issuecomment-121433601","issue_url":"https://api.github.com/repos/yesodweb/wai/issues/399","id":121433601,"user":{"login":"kazu-yamamoto","id":165387,"avatar_url":"https://avatars.githubusercontent.com/u/165387?v=3","gravatar_id":"","url":"https://api.github.com/users/kazu-yamamoto","html_url":"https://github.com/kazu-yamamoto","followers_url":"https://api.github.com/users/kazu-yamamoto/followers","following_url":"https://api.github.com/users/kazu-yamamoto/following{/other_user}","gists_url":"https://api.github.com/users/kazu-yamamoto/gists{/gist_id}","starred_url":"https://api.github.com/users/kazu-yamamoto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kazu-yamamoto/subscriptions","organizations_url":"https://api.github.com/users/kazu-yamamoto/orgs","repos_url":"https://api.github.com/users/kazu-yamamoto/repos","events_url":"https://api.github.com/users/kazu-yamamoto/events{/privacy}","received_events_url":"https://api.github.com/users/kazu-yamamoto/received_events","type":"User","site_admin":false},"created_at":"2015-07-15T00:17:40Z","updated_at":"2015-07-15T00:17:40Z","body":"@snoyberg I remembered that older \"http2\" does not provide `Network.HTTP2.Priority`. So, I added the lower boundary."}}