Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunWithPoll ¶
RunWithPoll use redsync to leader elect
Types ¶
type LeaderCallbacks ¶
type LeaderElectionConfig ¶
type LeaderElector ¶
func NewLeaderElector ¶
func NewLeaderElector(conf LeaderElectionConfig, rs *redsync.Redsync) *LeaderElector
func (*LeaderElector) Acquire ¶
func (le *LeaderElector) Acquire(ctx context.Context) error
Acquire attempt get lock and extend lock
func (*LeaderElector) IsLeader ¶
func (le *LeaderElector) IsLeader() bool
IsLeader check current server is leader
Click to show internal directories.
Click to hide internal directories.
