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

Changed AsyncAPIConsumer.get_action_name #206

Closed

Conversation

Vae1ocks
Copy link

Changed this method so that action is attribute of class object by self.action

@@ -236,8 +236,8 @@ async def get_action_name(

Override this method if you do not want to use `{"action": "action_name"}` as the way to describe actions.
"""
action = content.pop("action")
Copy link
Member

Choose a reason for hiding this comment

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

Since a consumer instances might be handling multiple actions at once if actions by using @action(detached: true) setting this as an instance property is not a good idea.

You could look into using the contextvars module for this then the value would be scoped to the async task.

@Vae1ocks Vae1ocks closed this by deleting the head repository Jan 26, 2025
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.

2 participants