From 1364dca5a6e4293acc6a289aac41a32d226c759a Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Sat, 25 Aug 2018 17:10:25 -0700 Subject: [PATCH] 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. --- lnpeer/peer.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lnpeer/peer.go b/lnpeer/peer.go index 99efe845..fb0e743c 100644 --- a/lnpeer/peer.go +++ b/lnpeer/peer.go @@ -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{} }