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:
parent
169cb723ce
commit
1364dca5a6
@ -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{}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user