-
Couldn't load subscription status.
- Fork 6
Add method to re-send dispatch states after startup #86
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
Conversation
Signed-off-by: Mathias L. Baumann <[email protected]>
|
Maybe this? @llucax @ela-kotulska-frequenz |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is still about recovering for a crashed actor, I would just re-create the receiver by calling running_status_change.new_receiver in the _run() instead of the constructor. This should also fix the issue, right?
| Warning: Usually you don't need to call this method. It is only useful | ||
| when you need to recover the current running state of your actor. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will highlight the warning properly:
| Warning: Usually you don't need to call this method. It is only useful | |
| when you need to recover the current running state of your actor. | |
| Warning: | |
| Usually you don't need to call this method. It is only useful | |
| when you need to recover the current running state of your actor. |
No, the dispatches are fetched on Dispatch.start(), not on new_receiver(). You don't get a new "current running status" if you create a new receiver |
|
Shouldn't Dispatcher communicate with an actor by channels? |
I don't understand this. So some actor at some point needs to subscribe to dispatches, they create a new receiver for status changes and start acting on it. Does this mean that with the current design each actor needs to instantiate its own dispatcher to get the proper running states because otherwise only the first actor that gets a receiver gets them? Otherwise maybe you can explain more precisely what's the exact issue we want to solve here?
Yes, as I said in the other PR I'm OK to leave it as it is for now as a hack, as I guess it will be a while until we support inter-process communication in channels, and we'll probably need to make some adjustments everywhere, but I would at least document that this is a hack and in the future we need to use a channel to send commands to the actor. |
|
Usually you set up all your receivers and channels before you even call If for any reason the receiving actor (usually that's the DispatchManagingActor, but API users might need more nuanced control for their scenarios) forgets their state and whether they should be running, that method can give them that state again. |
No description provided.