coroutine

package
v1.11.7 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2023 License: Apache-2.0 Imports: 4 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Context added in v1.11.5

func Context() context.Context

Context 获取全局顶层context

func GetContextWithCancel added in v1.11.5

func GetContextWithCancel() (context.Context, context.CancelFunc)

func Shutdown added in v1.11.5

func Shutdown()

Shutdown 关闭应用程序, 通知所有协程退出

Types

type RollingMutex

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

RollingMutex 按指定rolling策略加锁, 指定周期内只加载一次

滑动窗口锁, 窗口期内只初始化一次, 目前只支持1天切换

func (*RollingMutex) Date

func (o *RollingMutex) Date() string

func (*RollingMutex) Do

func (o *RollingMutex) Do(f func(), today ...func() (newDate string))

func (*RollingMutex) Reset

func (o *RollingMutex) Reset()

Jump to

Keyboard shortcuts

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