Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var TickerInterval = time.Millisecond * 50
TickerInterval defines the interval used by the ticker in Check* functions.
Functions ¶
func CheckContext ¶
CheckContext snapshots the currently-running goroutines and returns a function to be run at the end of tests to see whether any goroutines leaked.
Types ¶
type NumGoroutine ¶
type NumGoroutine struct { context.Context context.CancelFunc // contains filtered or unexported fields }
监测子协程是否跑完,需要代码层面的配合 一点都不优雅 没什么优不优雅,这就像wg.Add(1)
func New ¶
func New(callback func()) *NumGoroutine
func (*NumGoroutine) Cancel ¶
func (ng *NumGoroutine) Cancel()
func (*NumGoroutine) End ¶
func (ng *NumGoroutine) End()
func (*NumGoroutine) Start ¶
func (ng *NumGoroutine) Start()
type TaskPool ¶
type TaskPool struct {
// contains filtered or unexported fields
}
func NewTaskPool ¶
Click to show internal directories.
Click to hide internal directories.