Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dont work with ProactorEventLoop? #237

Closed
NewUserHa opened this issue Jun 16, 2019 · 8 comments · Fixed by #238
Closed

dont work with ProactorEventLoop? #237

NewUserHa opened this issue Jun 16, 2019 · 8 comments · Fixed by #238

Comments

@NewUserHa
Copy link
Contributor

  • aiohttp-devtools version: 0.13
  • aiohttp version: 3.5.4
  • python version: 3.7.3
  • Platform: win10
from aiohttp import web
import asyncio

async def handle(request):
    return web.Response(text=f'loop: {request.app.loop} {asyncio.get_event_loop()} {asyncio.get_event_loop_policy()}')

asyncio.set_event_loop(asyncio.ProactorEventLoop())
asyncio.set_event_loop_policy(asyncio.WindowsProactorEventLoopPolicy())
app = web.Application()
app.router.add_get('/', handle)

return

loop: <_WindowsSelectorEventLoop running=True closed=False debug=False> <_WindowsSelectorEventLoop running=True closed=False debug=False> <asyncio.windows_events.WindowsProactorEventLoopPolicy object at 0x000002AC28A62080>
@samuelcolvin
Copy link
Member

What command are your running?

@NewUserHa
Copy link
Contributor Author

adev runserver that.py

@samuelcolvin
Copy link
Member

Does it run fine if you use normal run_app?

@NewUserHa
Copy link
Contributor Author

yes.
you can use that code snippet to try

@samuelcolvin
Copy link
Member

I don't have windows.

May be possible to fix but without windows I can't help.

@NewUserHa
Copy link
Contributor Author

tried to add set_event_loop to main's runserver or run_app of adev but dont work

@samuelcolvin
Copy link
Member

#238

@NewUserHa
Copy link
Contributor Author

cool~
fixed.
thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants