bbgo_origin/pkg/bbgo/strategycontroller_callbacks.go

36 lines
768 B
Go
Raw Permalink Normal View History

2022-04-21 09:54:16 +00:00
// Code generated by "callbackgen -type StrategyController strategy_controller.go"; DO NOT EDIT.
package bbgo
import ()
func (s *StrategyController) OnSuspend(cb func()) {
s.suspendCallbacks = append(s.suspendCallbacks, cb)
2022-04-21 09:54:16 +00:00
}
func (s *StrategyController) EmitSuspend() {
for _, cb := range s.suspendCallbacks {
2022-04-21 09:54:16 +00:00
cb()
}
}
func (s *StrategyController) OnResume(cb func()) {
s.resumeCallbacks = append(s.resumeCallbacks, cb)
2022-04-21 09:54:16 +00:00
}
func (s *StrategyController) EmitResume() {
for _, cb := range s.resumeCallbacks {
2022-04-21 09:54:16 +00:00
cb()
}
}
func (s *StrategyController) OnEmergencyStop(cb func()) {
s.emergencyStopCallbacks = append(s.emergencyStopCallbacks, cb)
2022-04-21 09:54:16 +00:00
}
func (s *StrategyController) EmitEmergencyStop() {
for _, cb := range s.emergencyStopCallbacks {
2022-04-21 09:54:16 +00:00
cb()
}
}