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

Add support for uvloop #133

Merged
merged 1 commit into from Oct 18, 2016
Merged

Add support for uvloop #133

merged 1 commit into from Oct 18, 2016

Conversation

dirn
Copy link
Contributor

@dirn dirn commented Oct 17, 2016

uvloop is an alternate event loop for use with asyncio. While it's easy
to provide a specific event loop for a Henson application to use when
calling run_forever directly, there's no easy way to do so when using
the henson run CLI. Because uvloop is a drop-in replacement, it's easy
to add support for it directly into Henson by checking for it at run
time.

I had originally implemented this by setting the event loop policy at
compile time. While that approach feels a tad bit cleaner (easier to
remove if we need to stop support uvloop), this approach is much easier
to test.

@@ -9,6 +9,7 @@ Release TDB
- References to objects used by ``henson.Application`` are removed once they
are no longer needed to allow the memory to be freed up before the next
message is received.
- uvloop will be used for the event loop if it's installed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to link to the uvloop docs here.

uvloop is an alternate event loop for use with asyncio. While it's easy
to provide a specific event loop for a Henson application to use when
calling `run_forever` directly, there's no easy way to do so when using
the `henson run` CLI. Because uvloop is a drop-in replacement, it's easy
to add support for it directly into Henson by checking for it at run
time.

I had originally implemented this by setting the event loop policy at
compile time. While that approach feels a tad bit cleaner (easier to
remove if we need to stop support uvloop), this approach is much easier
to test.
@jonafato jonafato merged commit e42a389 into master Oct 18, 2016
@jonafato jonafato deleted the alternate-loops branch October 18, 2016 19:13
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

Successfully merging this pull request may close these issues.

None yet

2 participants