-
Notifications
You must be signed in to change notification settings - Fork 23
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
Events With Multiple Local Handlers Can Be Interfered By Each Other #16
Comments
The proposal will solve this issue on a small level, but when the payload size is big and there are multiple consumers who are consuming the dispatched event at the same time this will become a big issue it will block all the memory. Especially for long-running tasks or coroutines. |
@danielhasan1 you're right. I haven't tried to address this issue because the I'm also not aware of any "standard" approach to making a I think it's best we keep this unfixed for now. |
I think it's not about this library, it's about our design. events should be immutable. as a developer you should try design to have immutable events. for example you can try pydantic frozen classes or frozen dataclass or something that guarantee immutable events. |
Today, an event with multiple local handlers registered can interfere with each other as all handlers are given the same shared copy of events.
For instance,
Proposal
A copy of the payload should be passed to the handlers.
The text was updated successfully, but these errors were encountered: