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 message passing mutability issue #125

Open
porkbrain opened this issue Apr 1, 2019 · 0 comments
Open

Fix message passing mutability issue #125

porkbrain opened this issue Apr 1, 2019 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@porkbrain
Copy link
Contributor

Describe the bug
When an event is fired and has two listeners they share a reference to a single instance.

Expected behaviour
Listeners should have separated instance references. The event should only be mutated by middleware. This might be easier to implement for messages as their payload gets serialized.

Maybe we could create a new class that extends Event such as CloneableEvent which will have an abstract method clone () -> CloneableEvent. The programmer still can use unsafe Event, but for libraries (and Exteranto events), CloneableEvent could be used.

@porkbrain porkbrain added the bug Something isn't working label Apr 1, 2019
@porkbrain porkbrain self-assigned this Apr 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant