Closed elon0823 closed 2 years ago
I figured out the zookeeper watch methods (GetW, ChildrenW..) are one-time events. So on zk-implementation, it is required to re-register the watch event for each method. refer
apache curator style zk composition is good.
but, is this not over-design? say what happened its helper codes. how changes to take over convenience for a developer?
Did you mean a interface of the Coordinator is over-designed? Then i'm agree with that it is a little over-designed, but I think it is good to encapsulate and extend the zk dependency from all the Shaple projects. Because some Shaple projects needs to implement extra recipies (optimistic-lock, atomic-counter, recursive-watch, etc) which could be resued throughout the Shaple projects and I expected the Coordinator would support them like the apache curator do.
All the go-lang based Shaple project developers can cooperate with each other easily by supporting its coordinator helpers and reusing the helpers of other projects.
related to #165, merging #164 must be preceded
Design overview
In ca894e46045bb637c045604fd3da047a8b7d81a4, I designed
Coordinator
interface as belowand implement zookeeper implementation for the
Coordiatnor
interface as below.In a1aa4942a8306df1e5b7f458b485b5317477df5d, you can check how to utilize the
Coordinator
implementation oncoordinator-helper
package. And functional tests for zk-coordinator is added (3497f59d5308a847bec0ca8757f54328674c6069)