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

Create consumer hooks #3

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

linspw
Copy link

@linspw linspw commented May 2, 2023

The idea of ​​this PR:
It's creating hooks, to avoid overwriting all hook actions and thus not wanting to overwrite something vital for the operation.

async def pre_connect(self) -> None:
user = self.scope["user"]
if not user.is_staff:
await self.close()
Copy link
Author

Choose a reason for hiding this comment

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

Here's a problem: how to return in the parent function to not execute the next code instructions?

@stefanw
Copy link
Owner

stefanw commented May 15, 2023

I'm unsure about this. If you need to extend more behaviour, maybe just replacing the method and calling super() when needed works?

@linspw
Copy link
Author

linspw commented May 18, 2023

Hi @stefanw , the idea here is to create hooks to prevent the developer from having to overwrite/understand some implementations, it would be an "additional feature"

Thinking about features, it would be something similar to Hocuspocus server Hooks, https://tiptap.dev/hocuspocus/server/hooks

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