mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-14 05:41:21 +00:00
service#Start, service#Stop signatures were changed
See https://github.com/tendermint/tmlibs/issues/45
This commit is contained in:
@ -47,10 +47,10 @@ type WSClient struct {
|
||||
onReconnect func()
|
||||
|
||||
// internal channels
|
||||
send chan types.RPCRequest // user requests
|
||||
backlog chan types.RPCRequest // stores a single user request received during a conn failure
|
||||
reconnectAfter chan error // reconnect requests
|
||||
readRoutineQuit chan struct{} // a way for readRoutine to close writeRoutine
|
||||
send chan types.RPCRequest // user requests
|
||||
backlog chan types.RPCRequest // stores a single user request received during a conn failure
|
||||
reconnectAfter chan error // reconnect requests
|
||||
readRoutineQuit chan struct{} // a way for readRoutine to close writeRoutine
|
||||
|
||||
wg sync.WaitGroup
|
||||
|
||||
@ -168,12 +168,12 @@ func (c *WSClient) OnStop() {}
|
||||
|
||||
// Stop overrides cmn.Service#Stop. There is no other way to wait until Quit
|
||||
// channel is closed.
|
||||
func (c *WSClient) Stop() bool {
|
||||
success := c.BaseService.Stop()
|
||||
func (c *WSClient) Stop() error {
|
||||
err := c.BaseService.Stop()
|
||||
// only close user-facing channels when we can't write to them
|
||||
c.wg.Wait()
|
||||
close(c.ResponsesCh)
|
||||
return success
|
||||
return err
|
||||
}
|
||||
|
||||
// IsReconnecting returns true if the client is reconnecting right now.
|
||||
|
@ -196,7 +196,7 @@ func TestNotBlockingOnStop(t *testing.T) {
|
||||
|
||||
func startClient(t *testing.T, addr net.Addr) *WSClient {
|
||||
c := NewWSClient(addr.String(), "/websocket")
|
||||
_, err := c.Start()
|
||||
err := c.Start()
|
||||
require.Nil(t, err)
|
||||
c.SetLogger(log.TestingLogger())
|
||||
return c
|
||||
|
Reference in New Issue
Block a user