Skip to content
This repository was archived by the owner on Dec 7, 2019. It is now read-only.

Add Close method to the ConnManager interface #18

Merged
merged 1 commit into from
May 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ type ConnManager interface {
// The return value indicates whether the peer continues to be protected after this call, by way of a different tag.
// See notes on Protect() for more info.
Unprotect(id peer.ID, tag string) (protected bool)

// Close closes the connection manager and stops background processes
Close() error
}

// TagInfo stores metadata associated with a peer.
Expand Down
1 change: 1 addition & 0 deletions null.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ func (_ NullConnMgr) TrimOpenConns(context.Context) {}
func (_ NullConnMgr) Notifee() inet.Notifiee { return &cmNotifee{} }
func (_ NullConnMgr) Protect(peer.ID, string) {}
func (_ NullConnMgr) Unprotect(peer.ID, string) bool { return false }
func (_ NullConnMgr) Close() error { return nil }

type cmNotifee struct{}

Expand Down