Skip to content

Commit

Permalink
ending listener goroutine when session is received
Browse files Browse the repository at this point in the history
  • Loading branch information
andrebires committed Jan 26, 2022
1 parent f95c377 commit ab4148e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@ func receiveFromTransport(ctx context.Context, c *channel, done chan<- struct{})
case <-ctx.Done():
return
case c.inSesChan <- e:
// If a session was received while established,
// the listener should be ended
return
}
default:
panic(fmt.Errorf("unknown envelope type %v", reflect.ValueOf(e)))
Expand Down

0 comments on commit ab4148e

Please sign in to comment.