mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
add stream callbacks
This commit is contained in:
parent
2538824661
commit
8c50ce725c
19
pkg/exchange/okex/stream_callbacks.go
Normal file
19
pkg/exchange/okex/stream_callbacks.go
Normal file
|
@ -0,0 +1,19 @@
|
|||
// Code generated by "callbackgen -type Stream -interface"; DO NOT EDIT.
|
||||
|
||||
package okex
|
||||
|
||||
import ()
|
||||
|
||||
func (s *Stream) OnKline(cb func()) {
|
||||
s.klineCallbacks = append(s.klineCallbacks, cb)
|
||||
}
|
||||
|
||||
func (s *Stream) EmitKline() {
|
||||
for _, cb := range s.klineCallbacks {
|
||||
cb()
|
||||
}
|
||||
}
|
||||
|
||||
type StreamEventHub interface {
|
||||
OnKline(cb func())
|
||||
}
|
Loading…
Reference in New Issue
Block a user