Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

Commit

Permalink
decaying tags: support removal and closure. (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
raulk authored May 15, 2020
1 parent e74305c commit a1c90aa
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions connmgr/decay.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,23 @@ type DecayingTag interface {
// will be applied asynchronously, and a non-nil error indicates a fault
// when queuing.
Bump(peer peer.ID, delta int) error

// Remove removes a decaying tag from a peer. The removal will be applied
// asynchronously, and a non-nil error indicates a fault when queuing.
Remove(peer peer.ID) error

// Close closes a decaying tag. The Decayer will stop tracking this tag,
// and the state of all peers in the Connection Manager holding this tag
// will be updated.
//
// The deletion is performed asynchronously.
//
// Once deleted, a tag should not be used, and further calls to Bump/Remove
// will error.
//
// Duplicate calls to Remove will not return errors, but a failure to queue
// the first actual removal, will (e.g. when the system is backlogged).
Close() error
}

// DecayingValue represents a value for a decaying tag.
Expand Down

0 comments on commit a1c90aa

Please sign in to comment.