Skip to content

UrlDispatcher.add_route with partial coroutine handler#814

Merged
asvetlov merged 2 commits intomasterfrom
unknown repository
Mar 12, 2016
Merged

UrlDispatcher.add_route with partial coroutine handler#814
asvetlov merged 2 commits intomasterfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Mar 5, 2016

fix for problem when partialy applied coroutine is used as handler for UrlDispatcher.add_route

similar issue:
http://bugs.python.org/issue23519

@asyncio.coroutine
def handler_wrapper(*args, **kwargs):
result = handler(*args, **kwargs)
if asyncio.iscoroutine(result):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please add a check for asyncio.Future also.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

according to current documentation (for UrlDispatcher.add_route and Resource.add_route) handler should be callable which excludes asyncio.Future

@asvetlov
Copy link
Copy Markdown
Member

asvetlov commented Mar 7, 2016

Tests needed.

@ghost
Copy link
Copy Markdown
Author

ghost commented Mar 8, 2016

test added

asvetlov added a commit that referenced this pull request Mar 12, 2016
UrlDispatcher.add_route with partial coroutine handler
@asvetlov asvetlov merged commit dd335c1 into aio-libs:master Mar 12, 2016
@asvetlov
Copy link
Copy Markdown
Member

thanks

@lock
Copy link
Copy Markdown

lock bot commented Oct 29, 2019

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Oct 29, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant