Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 089fd28

Browse files
authored
Merge pull request xtaci#92 from zachzhaozy/add-function-closechan-for-session-module
Add CloseChan function to session module
2 parents 09e2c01 + c76d829 commit 089fd28

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

session.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,12 @@ func (s *Session) Close() error {
207207
}
208208
}
209209

210+
// CloseChan can be used by someone who wants to be notified immediately when this
211+
// session is closed
212+
func (s *Session) CloseChan() <-chan struct{} {
213+
return s.die
214+
}
215+
210216
// notifyBucket notifies recvLoop that bucket is available
211217
func (s *Session) notifyBucket() {
212218
select {

0 commit comments

Comments
 (0)