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

Fix the subscribe listener API #159

Closed
tvoinarovskyi opened this issue Apr 19, 2017 · 0 comments
Closed

Fix the subscribe listener API #159

tvoinarovskyi opened this issue Apr 19, 2017 · 0 comments

Comments

@tvoinarovskyi
Copy link
Member

tvoinarovskyi commented Apr 19, 2017

One of the idea's of listener's API is to allow setUp and tearDown of topic or partition resources. Like invalidate or populate caches, commit last batch of messages, etc.
In the current implementation we only allow to call functions on_partitions_revoked and on_partitions_assigned. It will not stall group management (new messages will be fetched right away, Join Group will happen right away) defeating the purpose.

TODO:

  • Instead of just calling callbacks, check if on_partitions_assigned and on_partitions_revoked are by any chance coroutine functions (asyncio.iscoroutinefunction) and await them if they are.
  • Add an example of usage to consumer.rst docs. Fix subscribe docstring.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant