retry

package
v0.0.0-...-edd4e79 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 27, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DelayTask

type DelayTask struct {
	// contains filtered or unexported fields
}

type DelayTaskSchedule

type DelayTaskSchedule struct {
	// contains filtered or unexported fields
}

func NewDelayTaskSchedule

func NewDelayTaskSchedule(ctx context.Context, handler func(key string, data interface{}), options ...Option) *DelayTaskSchedule

func NewSchedule

func NewSchedule(ctx context.Context, options ...Option) *DelayTaskSchedule

func (*DelayTaskSchedule) Create

func (d *DelayTaskSchedule) Create(task *Task) error

func (*DelayTaskSchedule) Delete

func (d *DelayTaskSchedule) Delete(key string)

func (*DelayTaskSchedule) Start

func (d *DelayTaskSchedule) Start()

type Option

type Option func(*DelayTaskSchedule)

func WithInterval

func WithInterval(interval time.Duration) Option

func WithSlotNum

func WithSlotNum(slotNum int) Option

type Task

type Task struct {
	MaxTimes     int
	MaxTime      time.Duration
	IntervalTime time.Duration

	Key        string
	Data       interface{}
	Job        func(task *Task)
	TimeoutJob func(task *Task)
	// contains filtered or unexported fields
}

type TimeWheel

type TimeWheel struct {
	// contains filtered or unexported fields
}

func NewTimeWheel

func NewTimeWheel(ctx context.Context, interval time.Duration, slotNum int, handler callbackHandler) *TimeWheel

func (*TimeWheel) CreateTask

func (t *TimeWheel) CreateTask(key string, delay time.Duration, data interface{}) error

func (*TimeWheel) DeleteTask

func (t *TimeWheel) DeleteTask(key string)

func (*TimeWheel) Run

func (t *TimeWheel) Run()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL