{"action":"created","issue":{"url":"https://api.github.com/repos/django/channels/issues/796","repository_url":"https://api.github.com/repos/django/channels","labels_url":"https://api.github.com/repos/django/channels/issues/796/labels{/name}","comments_url":"https://api.github.com/repos/django/channels/issues/796/comments","events_url":"https://api.github.com/repos/django/channels/issues/796/events","html_url":"https://github.com/django/channels/pull/796","id":277969565,"number":796,"title":"Fix issues surrounding multiplexers","user":{"login":"brianmay","id":112729,"avatar_url":"https://avatars3.githubusercontent.com/u/112729?v=4","gravatar_id":"","url":"https://api.github.com/users/brianmay","html_url":"https://github.com/brianmay","followers_url":"https://api.github.com/users/brianmay/followers","following_url":"https://api.github.com/users/brianmay/following{/other_user}","gists_url":"https://api.github.com/users/brianmay/gists{/gist_id}","starred_url":"https://api.github.com/users/brianmay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brianmay/subscriptions","organizations_url":"https://api.github.com/users/brianmay/orgs","repos_url":"https://api.github.com/users/brianmay/repos","events_url":"https://api.github.com/users/brianmay/events{/privacy}","received_events_url":"https://api.github.com/users/brianmay/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2017-11-30T01:42:49Z","updated_at":"2018-02-04T23:01:41Z","closed_at":"2018-02-04T23:01:41Z","author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/django/channels/pulls/796","html_url":"https://github.com/django/channels/pull/796","diff_url":"https://github.com/django/channels/pull/796.diff","patch_url":"https://github.com/django/channels/pull/796.patch"},"body":"Very rough. Not suitable for merging yet. Some known problems.\r\n\r\nPerhaps the biggest change is that I try to keep an instance for each consumer class recorded for each consumer instance, so it is possible to store per connection state variables.\r\n\r\nIn particular, if there are multiple consumers and they are derived from `WebsocketConsumer`, each one will call `accept()` when `connect()` is called. This is invalid, we can only call `accept()` once. \r\n\r\nThis change also sets the `base_send` method in the consumer. This was so the call the `accept()` wouldn't crash when it tries to send the acceptance packet. This feels like the wrong solution to me.\r\n\r\nI am wondering if maybe we need a new base class for multiplexer consumers, as a lot of the functionality for `WebsocketConsumer` is not really relevant anymore (at least in this implementation). Especially the sending stuff.\r\n\r\nIn my code, I have overridden the `connect()` method of the consumers not to call its super method. It works, but I don't consider this a good solution.\r\n\r\nI also feel uncomfortable removing the error conditions on calling the `send()` and `group_send()` methods in the `Demultiplexer`, however, these methods are currently used for sending responses (assuming I have understood how to do this correctly).\r\n\r\nI haven't extensively tested this yet to ensure it does the right thing, but it does seem to run without errors now. :-)\r\n\r\nStill needed, but not implemented:\r\n\r\n* Ability find Django user associated with websocket.\r\n* Identical stuff with async."},"comment":{"url":"https://api.github.com/repos/django/channels/issues/comments/362947906","html_url":"https://github.com/django/channels/pull/796#issuecomment-362947906","issue_url":"https://api.github.com/repos/django/channels/issues/796","id":362947906,"user":{"login":"brianmay","id":112729,"avatar_url":"https://avatars3.githubusercontent.com/u/112729?v=4","gravatar_id":"","url":"https://api.github.com/users/brianmay","html_url":"https://github.com/brianmay","followers_url":"https://api.github.com/users/brianmay/followers","following_url":"https://api.github.com/users/brianmay/following{/other_user}","gists_url":"https://api.github.com/users/brianmay/gists{/gist_id}","starred_url":"https://api.github.com/users/brianmay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brianmay/subscriptions","organizations_url":"https://api.github.com/users/brianmay/orgs","repos_url":"https://api.github.com/users/brianmay/repos","events_url":"https://api.github.com/users/brianmay/events{/privacy}","received_events_url":"https://api.github.com/users/brianmay/received_events","type":"User","site_admin":false},"created_at":"2018-02-04T23:01:41Z","updated_at":"2018-02-04T23:01:41Z","author_association":"CONTRIBUTOR","body":"Looks like this PR has been superseded by #825 :-). Will close."}}
{"actor":{"display_login":"brianmay"}}