Skip to content

Commit

Permalink
adding documentation on NotifyClose of connection and channel to enfo…
Browse files Browse the repository at this point in the history
…rce consuming returned channels (see PR issue_18) (#59)

Co-authored-by: Daniele Palaia <dpalaia@dpalaia-a02.vmware.com>
  • Loading branch information
DanielePalaia and Daniele Palaia authored Mar 31, 2022
1 parent 0a1a137 commit 7220a80
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,9 @@ this channel.
The chan provided will be closed when the Channel is closed and on a
graceful close, no error will be sent.
In case of a non graceful close the error will be notified synchronously by the library
so that it will be necessary to consume the Channel from the caller in order to avoid deadlocks
*/
func (ch *Channel) NotifyClose(c chan *Error) chan *Error {
ch.notifyM.Lock()
Expand Down
3 changes: 3 additions & 0 deletions connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,9 @@ accompanying a connection.close method or by a normal shutdown.
The chan provided will be closed when the Channel is closed and on a
graceful close, no error will be sent.
In case of a non graceful close the error will be notified synchronously by the library
so that it will be necessary to consume the Channel from the caller in order to avoid deadlocks
To reconnect after a transport or protocol error, register a listener here and
re-run your setup process.
Expand Down

0 comments on commit 7220a80

Please sign in to comment.