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

Added QueuedConsumer implementation #65

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tvoinarovskyi
Copy link
Contributor

With Python3.5 support for async with and async for.

NOTE: There are no tests for it. Can't wrap my head around how to implement a separate test for python35, any suggestions?

@TarasLevelUp
Copy link

I think this is a little too much to even view at a time. I will split up the Python3.5 and only create a PR for Python3.4 (with tests) later.

yield from self._consumer.cancel()


class QueuedConsumer:
Copy link
Owner

Choose a reason for hiding this comment

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

I wonder if it might make sense to make this class inherit asyncio.Queue, rather than just wrapping it. Then you'd get all of Queue's methods 'for free' (in particular I think get_nowait might be useful). What do you think?

@benjamin-hodgson
Copy link
Owner

Regarding testing 3.5-specific functionality - you should be able to just make a test which runs only in 3.5.

if PY35:
    class WhenTestingPython35SpecificFunctionality:
        ...

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.

3 participants