Skip to content

Commit

Permalink
lnpeer: extend Peer interface with new QuitSignal method
Browse files Browse the repository at this point in the history
In this commit, we extend the Peer interface with a new QuitSignal
method. This method is meant to expose a read-only quit channel which
will allow callers to cancel any actions based on the lifetime of the
underlying peer.
  • Loading branch information
Roasbeef committed Aug 26, 2018
1 parent 169cb72 commit 1364dca
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lnpeer/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,10 @@ type Peer interface {

// Address returns the network address of the remote peer.
Address() net.Addr

// QuitSignal is a method that should return a channel which will be
// sent upon or closed once the backing peer exits. This allows callers
// using the interface to cancel any processing in the event the backing
// implementation exits.
QuitSignal() <-chan struct{}
}

0 comments on commit 1364dca

Please sign in to comment.