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

Become leader and become follower callbacks #541

Open
as51340 opened this issue Oct 10, 2024 · 2 comments
Open

Become leader and become follower callbacks #541

as51340 opened this issue Oct 10, 2024 · 2 comments

Comments

@as51340
Copy link

as51340 commented Oct 10, 2024

Hi, I have a situation where when the instance becomes a leader and when it becomes a follower it has to perform some tasks which could take some time. Is it ok for NuRaft to block the thread which called the callback for some indefinite amount of time or should I do tasks asynchronously?

@greensky00
Copy link
Contributor

greensky00 commented Oct 12, 2024

If you are talking about the BecomeLeader and BecomeFollower callbacks, these are triggered by the NuRaft workers. Hence, it is advised not to perform any long-duration blocking tasks within these callbacks. Instead, handling such tasks asynchronously would be more preferred.

@as51340
Copy link
Author

as51340 commented Oct 14, 2024

thanks!

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

No branches or pull requests

2 participants