Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WaitGroup ¶
WaitGroup is a wrapper for sync.WaitGroup
func (*WaitGroup) Run ¶
func (w *WaitGroup) Run(exec func())
Run runs a function in a goroutine, adds 1 to WaitGroup and calls done when function returns. Please DO NOT use panic in the cb function.
func (*WaitGroup) RunWithRecover ¶
func (w *WaitGroup) RunWithRecover(exec func(), recoverFn func(r interface{}))
RunWithRecover wraps goroutine startup call with force recovery, add 1 to WaitGroup and call done when function return. it will dump current goroutine stack into log if catch any recover result. exec is that execute logic function. recoverFn is that handler will be called after recover and before dump stack, passing `nil` means noop.
Click to show internal directories.
Click to hide internal directories.