routine

package
v0.0.0-...-ac69a99 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: AGPL-3.0 Imports: 9 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAfterRoutine

func AddAfterRoutine(f AfterRoutine)

func AddBeforeRoutine

func AddBeforeRoutine(f BeforeRoutine)

func Go

func Go(f func() (err error))

func GoWithMustSuccess

func GoWithMustSuccess(f func() (err error))

func GoWithRecover

func GoWithRecover(f func() (err error))

Types

type AfterRoutine

type AfterRoutine func(currentGid int64)

type BeforeRoutine

type BeforeRoutine func(baseGid, currentGid int64)

type Cache

type Cache[K cmp.Ordered, V any] struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Cache 协程的信息缓存

func NewCache

func NewCache[K cmp.Ordered, V any]() *Cache[K, V]

func (*Cache[K, V]) Delete

func (p *Cache[K, V]) Delete(key K)

func (*Cache[K, V]) Get

func (p *Cache[K, V]) Get(key K) (V, bool)

func (*Cache[K, V]) GetWithDef

func (p *Cache[K, V]) GetWithDef(key K, def ...V) V

func (*Cache[K, V]) Set

func (p *Cache[K, V]) Set(key K, value V)

func (*Cache[K, V]) SetEx

func (p *Cache[K, V]) SetEx(key K, value V, ex time.Duration)

type Group

type Group struct {
}

Jump to

Keyboard shortcuts

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