lnpeer: extend Peer interface with new QuitSignal method

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.
This commit is contained in:
Olaoluwa Osuntokun 2018-08-25 17:10:25 -07:00
parent 169cb723ce
commit 1364dca5a6
No known key found for this signature in database
GPG Key ID: 964EA263DD637C21

View File

@ -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{}
}