Documentation
¶
Index ¶
- type Complete
- type Dispatcher
- type EmptyScheduler
- type HashDispatcher
- type Operation
- type OperationCode
- type QueueDispatcher
- type Scheduler
- type SimpleDispatcher
- type SimpleScheduler
- type Slot
- type Timer
- type TimingWheel
- func (t *TimingWheel) Add(tm *Timer)
- func (t *TimingWheel) After(d time.Duration, fn func()) *Timer
- func (t *TimingWheel) AfterInterval(d, i time.Duration, fn func()) *Timer
- func (t *TimingWheel) At(d time.Time, fn func()) (tm *Timer)
- func (t *TimingWheel) AtInterval(d time.Time, i time.Duration, fn func()) (tm *Timer)
- func (t *TimingWheel) Cancel(tm *Timer)
- func (t *TimingWheel) Count() int64
- func (t *TimingWheel) Interval(i time.Duration, fn func()) *Timer
- func (t *TimingWheel) Start()
- func (t *TimingWheel) Step()
- func (t *TimingWheel) Stop()
- func (t *TimingWheel) Wait()
- type Wheel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dispatcher ¶
type Dispatcher interface {
Start()
Stop()
Dispatch(func())
}
func NewHashDispatcher ¶
func NewHashDispatcher(args ...Dispatcher) Dispatcher
func NewQueueDispatcher ¶
func NewQueueDispatcher(length int, dispatcher Dispatcher) Dispatcher
func NewSimpleDispatcher ¶
func NewSimpleDispatcher() Dispatcher
type EmptyScheduler ¶
type EmptyScheduler struct{}
func (*EmptyScheduler) Schedule ¶
func (e *EmptyScheduler) Schedule(func())
func (*EmptyScheduler) Start ¶
func (e *EmptyScheduler) Start()
func (*EmptyScheduler) Stop ¶
func (e *EmptyScheduler) Stop()
type HashDispatcher ¶
type HashDispatcher struct {
// contains filtered or unexported fields
}
func (*HashDispatcher) Dispatch ¶
func (h *HashDispatcher) Dispatch(fn func())
func (*HashDispatcher) Start ¶
func (h *HashDispatcher) Start()
func (*HashDispatcher) Stop ¶
func (h *HashDispatcher) Stop()
type Operation ¶
type Operation struct {
// contains filtered or unexported fields
}
type OperationCode ¶
type OperationCode int8
const ( OP_REMOVE OperationCode = iota OP_AFTER OP_AT )
type QueueDispatcher ¶
type QueueDispatcher struct {
// contains filtered or unexported fields
}
func (*QueueDispatcher) Dispatch ¶
func (q *QueueDispatcher) Dispatch(fn func())
func (*QueueDispatcher) Start ¶
func (q *QueueDispatcher) Start()
func (*QueueDispatcher) Stop ¶
func (q *QueueDispatcher) Stop()
type Scheduler ¶
type Scheduler interface {
Start()
Stop()
Schedule(func())
}
func NewSimpleScheduler ¶
func NewSimpleScheduler(dispatcher Dispatcher) Scheduler
type SimpleDispatcher ¶
type SimpleDispatcher struct{}
func (*SimpleDispatcher) Dispatch ¶
func (s *SimpleDispatcher) Dispatch(fn func())
func (*SimpleDispatcher) Start ¶
func (s *SimpleDispatcher) Start()
func (*SimpleDispatcher) Stop ¶
func (s *SimpleDispatcher) Stop()
type SimpleScheduler ¶
type SimpleScheduler struct {
// contains filtered or unexported fields
}
func (*SimpleScheduler) Schedule ¶
func (s *SimpleScheduler) Schedule(fn func())
func (*SimpleScheduler) Start ¶
func (s *SimpleScheduler) Start()
func (*SimpleScheduler) Stop ¶
func (s *SimpleScheduler) Stop()
type Slot ¶
type Slot struct {
// contains filtered or unexported fields
}
type Timer ¶
type Timer struct {
// contains filtered or unexported fields
}
type TimingWheel ¶
type TimingWheel struct {
// contains filtered or unexported fields
}
func Default ¶
func Default(interval ...time.Duration) *TimingWheel
func NewTimingWheel ¶
func (*TimingWheel) Add ¶
func (t *TimingWheel) Add(tm *Timer)
func (*TimingWheel) After ¶
func (t *TimingWheel) After(d time.Duration, fn func()) *Timer
func (*TimingWheel) AfterInterval ¶
func (t *TimingWheel) AfterInterval(d, i time.Duration, fn func()) *Timer
func (*TimingWheel) At ¶
func (t *TimingWheel) At(d time.Time, fn func()) (tm *Timer)
func (*TimingWheel) AtInterval ¶
func (*TimingWheel) Cancel ¶
func (t *TimingWheel) Cancel(tm *Timer)
func (*TimingWheel) Count ¶
func (t *TimingWheel) Count() int64
func (*TimingWheel) Interval ¶
func (t *TimingWheel) Interval(i time.Duration, fn func()) *Timer
func (*TimingWheel) Start ¶
func (t *TimingWheel) Start()
func (*TimingWheel) Step ¶
func (t *TimingWheel) Step()
func (*TimingWheel) Stop ¶
func (t *TimingWheel) Stop()
func (*TimingWheel) Wait ¶
func (t *TimingWheel) Wait()
type Wheel ¶
type Wheel struct {
// contains filtered or unexported fields
}
Source Files
¶
- dispatcher.go
- scheduler.go
- slot.go
- timer.go
- timing.go
- types.go
- wheel.go
Click to show internal directories.
Click to hide internal directories.