expired

package
v0.0.0-...-3d1188e Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Expired

type Expired interface {
	Id() any
	ExpiredFunc()
}

type ExpiredCtx

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

func Init

func Init(ctx context.Context, num int) *ExpiredCtx

func (*ExpiredCtx) Remove

func (ec *ExpiredCtx) Remove(id any, expired bool) bool

func (*ExpiredCtx) SetWithDuration

func (ec *ExpiredCtx) SetWithDuration(a Expired, d time.Duration) bool

func (*ExpiredCtx) SetWithTime

func (ec *ExpiredCtx) SetWithTime(a Expired, t time.Time) bool

func (*ExpiredCtx) Stop

func (ec *ExpiredCtx) Stop()

func (*ExpiredCtx) UpdateWithDuration

func (ec *ExpiredCtx) UpdateWithDuration(id any, d time.Duration) bool

func (*ExpiredCtx) UpdateWithTime

func (ec *ExpiredCtx) UpdateWithTime(id any, t time.Time) bool

func (*ExpiredCtx) Wait

func (ec *ExpiredCtx) Wait()

type Scratchpads

type Scratchpads[T1 any, T2 any] struct {
	// contains filtered or unexported fields
}

func NewScratchpads

func NewScratchpads[T1 any, T2 any](e *ExpiredCtx, m *tmap.SyncMap[T1, T2], expiredTime time.Duration) *Scratchpads[T1, T2]

func (*Scratchpads[T1, T2]) Set

func (s *Scratchpads[T1, T2]) Set(k T1, v T2)

type TODO

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

func NewTODO

func NewTODO(e *ExpiredCtx) *TODO

func (*TODO) Duration

func (t *TODO) Duration(td time.Duration, fn func()) bool

func (*TODO) Time

func (t *TODO) Time(tt time.Time, fn func()) bool

Jump to

Keyboard shortcuts

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