Documentation ¶
Index ¶
- type Dispatcher
- type IDSet
- type Node
- type RedisScheduleStorage
- func (s *RedisScheduleStorage) Add(nodeID string, id int64) error
- func (s *RedisScheduleStorage) Del(nodeID string, id int64) error
- func (s *RedisScheduleStorage) Foreach(nodeID string, h func(int64) bool) error
- func (s *RedisScheduleStorage) Get(nodeID string) (IDSet, error)
- func (s *RedisScheduleStorage) Nodes() ([]*Node, error)
- func (s *RedisScheduleStorage) NodesKeepAlive(nodes []*Node, ttl time.Duration) error
- func (s *RedisScheduleStorage) RemoveNode(nodeID string) error
- type ScheduleStorage
- type Scheduler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
Dispatcher
func NewDispatcher ¶
func (*Dispatcher) Put ¶
func (p *Dispatcher) Put(c *pb.Checker)
func (*Dispatcher) Remove ¶
func (p *Dispatcher) Remove(id int64)
func (*Dispatcher) Watch ¶
func (p *Dispatcher) Watch() <-chan *fetcher.Event
type RedisScheduleStorage ¶
type RedisScheduleStorage struct { Root string Redis *redis.Client NodesFunc func() ([]*Node, error) }
RedisScheduleStorage
func (*RedisScheduleStorage) Add ¶
func (s *RedisScheduleStorage) Add(nodeID string, id int64) error
func (*RedisScheduleStorage) Del ¶
func (s *RedisScheduleStorage) Del(nodeID string, id int64) error
func (*RedisScheduleStorage) Foreach ¶
func (s *RedisScheduleStorage) Foreach(nodeID string, h func(int64) bool) error
func (*RedisScheduleStorage) Nodes ¶
func (s *RedisScheduleStorage) Nodes() ([]*Node, error)
func (*RedisScheduleStorage) NodesKeepAlive ¶
func (s *RedisScheduleStorage) NodesKeepAlive(nodes []*Node, ttl time.Duration) error
func (*RedisScheduleStorage) RemoveNode ¶
func (s *RedisScheduleStorage) RemoveNode(nodeID string) error
type ScheduleStorage ¶
type ScheduleStorage interface { Nodes() ([]*Node, error) NodesKeepAlive(nodes []*Node, ttl time.Duration) error RemoveNode(nodeID string) error Get(nodeID string) (IDSet, error) Add(nodeID string, id int64) error Del(nodeID string, id int64) error Foreach(nodeID string, h func(int64) bool) error }
ScheduleStorage .
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler .
func NewScheduler ¶
func NewScheduler(source storage.Interface, storage ScheduleStorage, interval time.Duration, log logs.Logger) *Scheduler
NewScheduler .
func (*Scheduler) RemoveNode ¶
Click to show internal directories.
Click to hide internal directories.