bbgo_origin/pkg/bbgo/gracefulshutdown_callbacks.go

19 lines
380 B
Go
Raw Permalink Normal View History

2022-10-02 11:34:52 +00:00
// Code generated by "callbackgen -type GracefulShutdown"; DO NOT EDIT.
package bbgo
import (
"context"
"sync"
)
func (g *GracefulShutdown) OnShutdown(cb ShutdownHandler) {
g.shutdownCallbacks = append(g.shutdownCallbacks, cb)
}
func (g *GracefulShutdown) EmitShutdown(ctx context.Context, wg *sync.WaitGroup) {
for _, cb := range g.shutdownCallbacks {
cb(ctx, wg)
}
}