Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Clock clockwork.Clock = clockwork.NewRealClock() LeaderKey = "cronjob:leader" DefaultTTL = 10 * time.Minute )
Functions ¶
Types ¶
type DistributedElector ¶
type DistributedElector struct {
// contains filtered or unexported fields
}
func NewDistributedElector ¶
func NewDistributedElector(cmder redis.Cmdable) *DistributedElector
func (*DistributedElector) IsLeader ¶
func (e *DistributedElector) IsLeader(ctx context.Context) error
func (*DistributedElector) Lock ¶
func (e *DistributedElector) Lock(ctx context.Context, key string) (gocron.Lock, error)
func (*DistributedElector) Stop ¶
func (e *DistributedElector) Stop(ctx context.Context)
Click to show internal directories.
Click to hide internal directories.