fix(ftx): start go routine while connecting to ftx websocket

This commit is contained in:
Jui-Nan Lin 2021-05-24 09:22:47 +08:00
parent 02912f362c
commit 2394aab32e

View File

@ -58,7 +58,6 @@ func NewStream(key, secret string, subAccount string, e *Exchange) *Stream {
s.EmitConnect() s.EmitConnect()
}) })
go s.handleChannelKlineMessage()
return s return s
} }
@ -75,6 +74,7 @@ func (s *Stream) Connect(ctx context.Context) error {
s.ctx = ctx s.ctx = ctx
s.isConnected = true s.isConnected = true
s.EmitStart() s.EmitStart()
go s.handleChannelKlineMessage()
go func() { go func() {
// https://docs.ftx.com/?javascript#request-process // https://docs.ftx.com/?javascript#request-process