mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-14 11:03:53 +00:00
19 lines
356 B
Go
19 lines
356 B
Go
// Code generated by "callbackgen -type Graceful"; DO NOT EDIT.
|
|
|
|
package bbgo
|
|
|
|
import (
|
|
"context"
|
|
"sync"
|
|
)
|
|
|
|
func (g *Graceful) OnShutdown(cb ShutdownHandler) {
|
|
g.shutdownCallbacks = append(g.shutdownCallbacks, cb)
|
|
}
|
|
|
|
func (g *Graceful) EmitShutdown(ctx context.Context, wg *sync.WaitGroup) {
|
|
for _, cb := range g.shutdownCallbacks {
|
|
cb(ctx, wg)
|
|
}
|
|
}
|