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

Refactor jetcd watch #95

Closed
4 tasks done
wangweicugw opened this issue Jul 21, 2023 · 0 comments · Fixed by #112
Closed
4 tasks done

Refactor jetcd watch #95

wangweicugw opened this issue Jul 21, 2023 · 0 comments · Fixed by #112
Assignees

Comments

@wangweicugw
Copy link
Collaborator

wangweicugw commented Jul 21, 2023

Description:

The current implementation of jetcd watch logic is difficult to read and maintain. The code is complex and has too many nested loops, which makes it hard to understand the flow of execution. To improve the code, we propose refactoring the watch logic to use a thread pool and listener pattern.

The thread pool will allow us to handle multiple watch events concurrently, improving the system's efficiency and reducing latency. Meanwhile, the listener pattern will help decouple the watch logic from the rest of the system, making it more modular and easier to maintain.

Some possible steps to implement this refactoring include:

  • Creating a thread pool to handle watch events
  • Refactoring the watch logic to use a listener pattern
  • Updating the code to use the new thread pool and listener pattern
  • Adding tests to ensure that the refactored code works correctly
@wangweicugw wangweicugw self-assigned this Aug 4, 2023
This was linked to pull requests Aug 4, 2023
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

Successfully merging a pull request may close this issue.

1 participant