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

Using Uvloop in Growler #8

Closed
machbio opened this issue May 11, 2016 · 2 comments
Closed

Using Uvloop in Growler #8

machbio opened this issue May 11, 2016 · 2 comments

Comments

@machbio
Copy link

machbio commented May 11, 2016

I recently came across Growler, it looks pretty good framework to move away from Flask that I am currently using.

But I have seen some improvements on the loop with https://github.com/MagicStack/uvloop - the benchmark seems to show it is better event loop as compared to Asyncio Event loop. so can I replace the Event loop from the current example to use Uvloop - just wanted to know if I am missing anything.

Asyncio Loop

loop = asyncio.get_event_loop()
app = App('GrowlerServer', loop=loop)

Uvloop

 loop = uvloop.new_event_loop()
 app = App('GrowlerServer', loop=loop)

I understand that #4 its been brought forward - but should it not be as straightforward as given above.

@akubera
Copy link
Member

akubera commented May 11, 2016

The way I'm using uvloop currently is

import uvloop
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())

at the beginning of my main.py, before the app is created. This is how http://growler.rocks is running (which is currently as single page site and any framework/accelerator is unnecessary).

Let me know if the other syntax works.

@machbio
Copy link
Author

machbio commented May 11, 2016

Thank you, looks like there is no need of worrying about uvloop integration

@machbio machbio closed this as completed May 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants