Documentation
¶
Index ¶
- Variables
- func Add(delta int)
- func CGO(f handle)
- func Cancel() bool
- func Done()
- func GO(f func())
- func SGO(f handle)
- func Stopped() bool
- func Timeout(d time.Duration, fn func() error) error
- func Trigger(handle func())
- func Try(f handle)
- func Wait(timeout time.Duration) (err error)
- func WithCancel() (context.Context, context.CancelFunc)
- func WithTimeout(t time.Duration) (context.Context, context.CancelFunc)
- func WithValue(parent context.Context, key, val any) context.Context
- type Daemon
- type SCC
- func (s *SCC) CGO(f handle)
- func (s *SCC) Cancel() bool
- func (s *SCC) Deadline() (deadline time.Time, ok bool)
- func (s *SCC) GO(f func())
- func (s *SCC) SGO(f handle)
- func (s *SCC) Stopped() bool
- func (s *SCC) Timeout(d time.Duration, fn func() error) error
- func (s *SCC) Trigger(f func())
- func (s *SCC) Try(f handle)
- func (s *SCC) Wait(timeout time.Duration) (err error)
- func (s *SCC) WithCancel() (context.Context, context.CancelFunc)
- func (s *SCC) WithTimeout(t time.Duration) (context.Context, context.CancelFunc)
- func (s *SCC) WithValue(parent context.Context, key, val any) context.Context
- type Worker
Constants ¶
This section is empty.
Variables ¶
View Source
var Default = New(nil)
View Source
var ErrorTimeout = errors.New("timeout")
Functions ¶
func WithCancel ¶ added in v1.1.0
func WithCancel() (context.Context, context.CancelFunc)
func WithTimeout ¶ added in v1.1.0
Types ¶
type SCC ¶
type SCC struct { sync.WaitGroup Catch func(error) //异常捕获,默认控制台打印 Context context.Context // contains filtered or unexported fields }
SCC 协程控制器
func (*SCC) WithCancel ¶ added in v1.1.0
func (s *SCC) WithCancel() (context.Context, context.CancelFunc)
func (*SCC) WithTimeout ¶ added in v1.1.0
Click to show internal directories.
Click to hide internal directories.