-
-
Notifications
You must be signed in to change notification settings - Fork 89
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
Multiple Observers not working on singular State machine #384
Comments
Hi @MKhibkin1 , I was able to reproduce the issue. Thanks for reporting this. The problem is that I've implemented an "unique" by name on the callback registry. I use the callback name to know if a callback is already registered. Here I check if the callback is already in the list: python-statemachine/statemachine/callbacks.py Lines 147 to 148 in c60f7fe
And here is how I compare two distinct callbacks (by it's name): python-statemachine/statemachine/callbacks.py Lines 29 to 30 in c60f7fe
I'm thinking about using a qualified name to the callback, including a identification of the observer, so even with multiple observers we still get unique names. |
@fgmacedo - I am really loving your library and excited to see this issue fixed. It looks like you haven't created a release since doing so? Is there a way I could help you to do the release - would like to get this fix. |
Hi @cmutzel, thanks for your kind words. I was waiting to deliver a more significant release. But let's release what we already have implemented. |
New version 2.1.0 released! 🎉 https://python-statemachine.readthedocs.io/en/latest/releases/2.1.0.html |
Description
I would like to have multiple observers responding to an event from a statemachine.
What I Did
I would expect to see both "I observed moving from 1" and "I observed moving from 2" but it seems the first observer to encounter the event will swallow the callback.
The text was updated successfully, but these errors were encountered: