Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DurCron ¶
type DurCron struct {
// contains filtered or unexported fields
}
Equal duration cron, it's concurrent-safe.
func NewDurCron ¶
NewDurCron creates new DurCron object. The origin is calc origin time, if it's nil, time.Now() used as origin. The d is cron interval.
func (*DurCron) CheckNowUnblock ¶
CheckNowUnblock returns true when now is a trigger point, otherwise false. Backlog trigger point history will be ignored, it just return latest trigger point.
type NtpCron ¶
type NtpCron struct {
// contains filtered or unexported fields
}
func NewNtpCronONLINE ¶
func NewNtpCronWithClock ¶
type RateLimiter ¶
type RateLimiter struct {
// contains filtered or unexported fields
}
func NewRateLimiter ¶
func NewRateLimiter(d time.Duration) *RateLimiter
func NewRateLimiterEx ¶
func NewRateLimiterEx(d time.Duration, c gtime.Clock) *RateLimiter
func (*RateLimiter) Get ¶
func (r *RateLimiter) Get() time.Duration
func (*RateLimiter) MarkAndWaitBlock ¶
func (r *RateLimiter) MarkAndWaitBlock()
func (*RateLimiter) MarkAndWaitUnblock ¶
func (r *RateLimiter) MarkAndWaitUnblock() bool
type RateLimiterPriority ¶
type RateLimiterPriority struct {
// contains filtered or unexported fields
}
func NewRateLimiterPriority ¶
func NewRateLimiterPriority(d time.Duration) *RateLimiterPriority
func (*RateLimiterPriority) Duration ¶
func (r *RateLimiterPriority) Duration() time.Duration
func (*RateLimiterPriority) TakeWait ¶
func (r *RateLimiterPriority) TakeWait(priority uint)
mark and wait block
Source Files ¶
Click to show internal directories.
Click to hide internal directories.