{"action":"created","issue":{"url":"https://api.github.com/repos/django/daphne/issues/195","repository_url":"https://api.github.com/repos/django/daphne","labels_url":"https://api.github.com/repos/django/daphne/issues/195/labels{/name}","comments_url":"https://api.github.com/repos/django/daphne/issues/195/comments","events_url":"https://api.github.com/repos/django/daphne/issues/195/events","html_url":"https://github.com/django/daphne/issues/195","id":318429435,"number":195,"title":"[Question] Warning about Twisted reactor","user":{"login":"abhrj","id":38240391,"avatar_url":"https://avatars1.githubusercontent.com/u/38240391?v=4","gravatar_id":"","url":"https://api.github.com/users/abhrj","html_url":"https://github.com/abhrj","followers_url":"https://api.github.com/users/abhrj/followers","following_url":"https://api.github.com/users/abhrj/following{/other_user}","gists_url":"https://api.github.com/users/abhrj/gists{/gist_id}","starred_url":"https://api.github.com/users/abhrj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhrj/subscriptions","organizations_url":"https://api.github.com/users/abhrj/orgs","repos_url":"https://api.github.com/users/abhrj/repos","events_url":"https://api.github.com/users/abhrj/events{/privacy}","received_events_url":"https://api.github.com/users/abhrj/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-04-27T14:24:49Z","updated_at":"2018-04-30T19:01:10Z","closed_at":"2018-04-27T16:30:33Z","author_association":"NONE","body":"In a django app that is using daphne + channels 2, when running any command such as `./manage.py migrate` or `daphne I see the following warning:\r\n\r\n```\r\nvenv/lib/python3.6/site-packages/daphne/server.py:12: UserWarning: Something has already installed a\r\nnon-asyncio Twisted reactor. Attempting to uninstall it; you can fix this warning by importing\r\ndaphne.server early in your codebase or finding the package that imports Twisted and importing it later\r\non.\r\n```\r\n\r\nI found out the other library which was installing a \"non-asyncio Twisted reactor\". And I can probably delay its import.\r\n\r\nBut I have some questions:\r\n* If I import the other library after daphne, wouldn't daphne's reactor get replaced?\r\n* If the other library is based on a sync reactor, is it incompatible with daphne?"},"comment":{"url":"https://api.github.com/repos/django/daphne/issues/comments/385496222","html_url":"https://github.com/django/daphne/issues/195#issuecomment-385496222","issue_url":"https://api.github.com/repos/django/daphne/issues/195","id":385496222,"user":{"login":"abhrj","id":38240391,"avatar_url":"https://avatars1.githubusercontent.com/u/38240391?v=4","gravatar_id":"","url":"https://api.github.com/users/abhrj","html_url":"https://github.com/abhrj","followers_url":"https://api.github.com/users/abhrj/followers","following_url":"https://api.github.com/users/abhrj/following{/other_user}","gists_url":"https://api.github.com/users/abhrj/gists{/gist_id}","starred_url":"https://api.github.com/users/abhrj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abhrj/subscriptions","organizations_url":"https://api.github.com/users/abhrj/orgs","repos_url":"https://api.github.com/users/abhrj/repos","events_url":"https://api.github.com/users/abhrj/events{/privacy}","received_events_url":"https://api.github.com/users/abhrj/received_events","type":"User","site_admin":false},"created_at":"2018-04-30T19:01:10Z","updated_at":"2018-04-30T19:01:10Z","author_association":"NONE","body":"Thanks for your quick responses.\r\n\r\nThe other library in my case is raven, and I found a related issue here: https://github.com/django/channels/issues/793 but a question: In [this code](https://github.com/getsentry/raven-python/blob/master/raven/transport/twisted.py#L36) the raven library imports `twisted.internet.reactor` and then passes it along to other classes.\r\n\r\nDoes that qualify as an explicit installation of the reactor, or an implicit / default one? I am guessing it's implicit installation, and raven doesn't care what exact reactor is installed. But just wanted to double check.\r\n\r\nSorry if this is too off-topic for daphne. I hope it's a common enough problem to discuss here."}}
{"actor":{"display_login":"abhrj"}}