refactor: Centralize stream handling and helper functions in relay package
This commit is contained in:
@@ -12,7 +12,6 @@ var relayGoPool gopool.Pool
|
||||
func init() {
|
||||
relayGoPool = gopool.NewPool("gopool.RelayPool", math.MaxInt32, gopool.NewConfig())
|
||||
relayGoPool.SetPanicHandler(func(ctx context.Context, i interface{}) {
|
||||
//check ctx.Value("stop_chan").(chan bool)
|
||||
if stopChan, ok := ctx.Value("stop_chan").(chan bool); ok {
|
||||
SafeSendBool(stopChan, true)
|
||||
}
|
||||
@@ -20,6 +19,6 @@ func init() {
|
||||
})
|
||||
}
|
||||
|
||||
func CtxGo(ctx context.Context, f func()) {
|
||||
func RelayCtxGo(ctx context.Context, f func()) {
|
||||
relayGoPool.CtxGo(ctx, f)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user