Documentation ¶
Index ¶
- type AddTimerOption
- type Callback
- type OptionFunc
- func WithConcurrent(concurrent int) OptionFunc
- func WithContext(ctx context.Context) OptionFunc
- func WithEnableEvalRO(enableEvalRO bool) OptionFunc
- func WithInterval(interval time.Duration) OptionFunc
- func WithRetryMax(retryMax int) OptionFunc
- func WithRetrySleep(retrySleep time.Duration) OptionFunc
- func WithSlotNums(slotNums int64) OptionFunc
- type TimeWheel
- func (wheel *TimeWheel) AddTimer(id string, delay time.Duration, opts ...AddTimerOption) error
- func (wheel *TimeWheel) GetTimer(id string) (time.Duration, error)
- func (wheel *TimeWheel) RemoveTimer(id string) error
- func (wheel *TimeWheel) ResetTimer(id string, delay time.Duration) error
- func (wheel *TimeWheel) Run()
- func (wheel *TimeWheel) Stop()
- type Timer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddTimerOption ¶
type AddTimerOption func(*addTimerOptions)
func WithPayload ¶
func WithPayload(payload []byte) AddTimerOption
type OptionFunc ¶
type OptionFunc func(*TimeWheel)
func WithConcurrent ¶ added in v0.3.3
func WithConcurrent(concurrent int) OptionFunc
func WithContext ¶
func WithContext(ctx context.Context) OptionFunc
func WithEnableEvalRO ¶
func WithEnableEvalRO(enableEvalRO bool) OptionFunc
func WithInterval ¶
func WithInterval(interval time.Duration) OptionFunc
func WithRetryMax ¶ added in v0.3.4
func WithRetryMax(retryMax int) OptionFunc
retryMax == 0 means never retry retryMax < 0 means always retry
func WithRetrySleep ¶ added in v0.3.3
func WithRetrySleep(retrySleep time.Duration) OptionFunc
func WithSlotNums ¶
func WithSlotNums(slotNums int64) OptionFunc
type TimeWheel ¶
type TimeWheel struct {
// contains filtered or unexported fields
}
func NewTimeWheel ¶
func (*TimeWheel) RemoveTimer ¶
func (*TimeWheel) ResetTimer ¶ added in v0.3.2
Click to show internal directories.
Click to hide internal directories.