Documentation ¶
Overview ¶
Package loop 提供了一个循环执行某个方法的功能,可以自定义执行时间等。 用法: l := loop.New() l.Do(方法)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Loop ¶
type Loop struct {
// contains filtered or unexported fields
}
Loop 定义循环执行任务的对象.
func (*Loop) CalculateInterval ¶
CalculateInterval 传入当前循环次数,计算间隔时间
type Option ¶
type Option func(*Loop)
Option 定义 Loop 对象的参数配置选项.
func WithContext ¶
WithContext set the context to cancel loop
func WithDeclineLimit ¶
WithDeclineLimit 设置衰退延迟的最大值,默认不限制最大值.
Click to show internal directories.
Click to hide internal directories.