monitor

package
v0.0.31 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Monitor

type Monitor struct {
	context.Context
	context.CancelFunc
	// contains filtered or unexported fields
}

监测子协程是否跑完,需要代码层面的配合 一点都不优雅 没什么优不优雅,这就像wg.Add(1)

func New

func New(ctx context.Context, callback func()) *Monitor

func (*Monitor) Cancel

func (ng *Monitor) Cancel()

func (*Monitor) Run

func (ng *Monitor) Run(fn func())

有没有可能父协程return后,子协程还没开始执行

Jump to

Keyboard shortcuts

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