{"action":"created","issue":{"url":"https://api.github.com/repos/django/channels/issues/935","repository_url":"https://api.github.com/repos/django/channels","labels_url":"https://api.github.com/repos/django/channels/issues/935/labels{/name}","comments_url":"https://api.github.com/repos/django/channels/issues/935/comments","events_url":"https://api.github.com/repos/django/channels/issues/935/events","html_url":"https://github.com/django/channels/pull/935","id":300139116,"number":935,"title":"Add de-multiplexer","user":{"login":"hishnash","id":838127,"avatar_url":"https://avatars0.githubusercontent.com/u/838127?v=4","gravatar_id":"","url":"https://api.github.com/users/hishnash","html_url":"https://github.com/hishnash","followers_url":"https://api.github.com/users/hishnash/followers","following_url":"https://api.github.com/users/hishnash/following{/other_user}","gists_url":"https://api.github.com/users/hishnash/gists{/gist_id}","starred_url":"https://api.github.com/users/hishnash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hishnash/subscriptions","organizations_url":"https://api.github.com/users/hishnash/orgs","repos_url":"https://api.github.com/users/hishnash/repos","events_url":"https://api.github.com/users/hishnash/events{/privacy}","received_events_url":"https://api.github.com/users/hishnash/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2018-02-26T07:54:21Z","updated_at":"2018-02-28T07:58:40Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/django/channels/pulls/935","html_url":"https://github.com/django/channels/pull/935","diff_url":"https://github.com/django/channels/pull/935.diff","patch_url":"https://github.com/django/channels/pull/935.patch"},"body":"Adds `AsyncJsonWebsocketDemultiplexer`\r\n\r\n@andrewgodwin  based on your changes in https://github.com/django/channels/commit/d6643d96dd59e153cda13681a6d5a8963b9d577c I was able to simplify this a lot :) without Futures/Tasks being raising lots of warnings.\r\n\r\nkey features of `AsyncJsonWebsocketDemultiplexer`\r\n\r\n* will send `websocket.accept` back only after the first upstream application responds in kind.\r\n* will block upstream `message frames` from being sent to upstream applications until said upstream application response with `websocket.accept`\r\n* if an upstream application sends `websocket.close` will remove it from the set up upstream applications that can receive `message frames`\r\n* if the last open upsteam application sends `websocket.close` then it will propagate that down to the server so that the connection closes.\r\n* when a `websocket.disconect` is received this is sent to all the child applications so they can close. They have `application_close_timeout=5` to close before they will be killed by the parent.\r\n* if the consumer loop of an upstream application completes then all upstream applications will be closed as well as the de-multiplexer!.\r\n\r\n\r\n# TODO\r\n- [ ] handle what happens if the upstream applications sends a binary frame?\r\n- [ ] Add lots of docs"},"comment":{"url":"https://api.github.com/repos/django/channels/issues/comments/369152157","html_url":"https://github.com/django/channels/pull/935#issuecomment-369152157","issue_url":"https://api.github.com/repos/django/channels/issues/935","id":369152157,"user":{"login":"andrewgodwin","id":36182,"avatar_url":"https://avatars1.githubusercontent.com/u/36182?v=4","gravatar_id":"","url":"https://api.github.com/users/andrewgodwin","html_url":"https://github.com/andrewgodwin","followers_url":"https://api.github.com/users/andrewgodwin/followers","following_url":"https://api.github.com/users/andrewgodwin/following{/other_user}","gists_url":"https://api.github.com/users/andrewgodwin/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewgodwin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewgodwin/subscriptions","organizations_url":"https://api.github.com/users/andrewgodwin/orgs","repos_url":"https://api.github.com/users/andrewgodwin/repos","events_url":"https://api.github.com/users/andrewgodwin/events{/privacy}","received_events_url":"https://api.github.com/users/andrewgodwin/received_events","type":"User","site_admin":false},"created_at":"2018-02-28T07:58:40Z","updated_at":"2018-02-28T07:58:40Z","author_association":"OWNER","body":"I can't even remember what channels v1 did, and I'm not trying to match its disconnection behaviour, as multiplexing there was very limited and buggy."}}
{"actor":{"display_login":"andrewgodwin"}}