-
-
Notifications
You must be signed in to change notification settings - Fork 954
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
fix 793: allow custom async iterator #1041
Conversation
@witling Also, it will be great to add tests to cover this feature. |
@uriyyo Thanks for the notes! I've updated my pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great for me
blocked by #1040 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, this looks like a simple and useful improvement.
Please rebase on or merge master. The CI should pass (or at least make it further) since #1042 was merged.
@JayH5 Thanks for your effort! I've updated my pr. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested a few tweaks to the tests, please move the test functions further up the file to be immediately after the existing tests for streaming responses. Thanks
Co-authored-by: Jamie Hewland <[email protected]>
Co-authored-by: Jamie Hewland <[email protected]>
annotations were implemented |
blocked by #1072 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your patience with this!
When a custom async iterator is passed to
StreamingResponse
, the type of object is determined byinspect.isasyncgen
. This method does anisinstance
check against the default python iterator and therefore does not work on custom objects implementing the async iterator protocol. (Closes #793)