Skip to content

Commit

Permalink
In this commit a CloseChan function is added to session module
Browse files Browse the repository at this point in the history
By this using this funcion, one can be notified immediately when a session is closed.
  • Loading branch information
zachzhaozy committed Nov 24, 2022
1 parent 09e2c01 commit c76d829
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions session.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,12 @@ func (s *Session) Close() error {
}
}

// CloseChan can be used by someone who wants to be notified immediately when this
// session is closed
func (s *Session) CloseChan() <-chan struct{} {
return s.die
}

// notifyBucket notifies recvLoop that bucket is available
func (s *Session) notifyBucket() {
select {
Expand Down

0 comments on commit c76d829

Please sign in to comment.