rewrite ws client to expose a callback instead of a channel

callback gives more power to the publisher. plus it is optional
comparing to a channel, which will block the whole client if you won't
read from it.
This commit is contained in:
Anton Kaliaev
2017-09-29 14:11:46 +04:00
committed by Zach Ramsay
parent ce36a0111a
commit 45ff7cdd0c
3 changed files with 19 additions and 10 deletions

View File

@ -186,8 +186,6 @@ func callWgDoneOnResult(t *testing.T, c *WSClient, wg *sync.WaitGroup) {
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
case <-c.ReconnectCh:
t.Log("Reconnected")
case <-c.Quit:
return
}