Skip to content

Commit

Permalink
refactor: use waitGroup() instead of wg in client
Browse files Browse the repository at this point in the history
  • Loading branch information
sruehl committed Jan 18, 2024
1 parent 9f6cd07 commit 800a6c0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ type client struct {
func (c *client) Start() {
c.setState(ClientConnecting)
boff := c.backoffFactory()
c.wg.Add(1)
c.partyBase.waitGroup().Add(1)
go func() {
defer c.wg.Done()
defer c.partyBase.waitGroup().Done()
for {
c.setErr(nil)
// Listen for state change to ClientConnected and signal backoff Reset then.
Expand Down Expand Up @@ -223,7 +223,7 @@ func (c *client) Start() {
func (c *client) Stop() {
if c.cancelFunc != nil {
c.cancelFunc()
c.wg.Wait()
c.partyBase.waitGroup().Wait()
c.setState(ClientClosed)
}
}
Expand Down

0 comments on commit 800a6c0

Please sign in to comment.