Closed byronhe closed 1 year ago
Thank you for your suggestion.
as the nuraft_global_mgr
class has many member variables and methods , I feel it is not suitable as an interface class. For example, the subclass we implemented did not use these member variables and methods.
in my opinion, add a global_mgr *
in context
can make the core raft logic independent of any global variables in multi-instance mode, which can make the code more easily adaptable to more scenarios, such as allowing multi-global_mgr-in-one-process testing.
Therefore, I have submitted a new pull request. Please review it: https://github.com/eBay/NuRaft/pull/441
Hi @byronhe
I suggest you doing in the below way, rather than adding it to
ctx_
and modifying existing static functions ofnuraft_global_mgr
which breaks the backward compatibility as well.In
ngm_singleton
, add a new function:In
nuraft_global_mgr
, add a new custom init functionMake below 4 functions
virtual
as you did:And the custom manager should inherit
nuraft_global_mgr
:Also please make all test pass.