Skip to content

Commit

Permalink
docs: add some missing method docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
mreiferson committed Nov 12, 2014
1 parent 7eb4205 commit 796ccde
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ func (h HandlerFunc) HandleMessage(m *Message) error {
return h(m)
}

// DiscoveryFilter interface
// one of the interfaces an argument to setBehaviorDelegate() can satisfy
// DiscoveryFilter is an interface accepted by `SetBehaviorDelegate()`
// for filtering the nsqds returned from discovery via nsqlookupd
type DiscoveryFilter interface {
Filter([]string) []string
Expand Down Expand Up @@ -191,6 +190,12 @@ func (r *Consumer) SetLogger(l logger, lvl LogLevel) {
r.logLvl = lvl
}

// SetBehaviorDelegate takes a type implementing one or more
// of the following interfaces that modify the behavior
// of the `Consumer`:
//
// DiscoveryFilter
//
func (r *Consumer) SetBehaviorDelegate(cb interface{}) {
matched := false

Expand Down Expand Up @@ -527,6 +532,8 @@ func indexOf(n string, h []string) int {
return -1
}

// DisconnectFromNSQD closes the connection to and removes the specified
// `nsqd` address from the list
func (r *Consumer) DisconnectFromNSQD(addr string) error {
r.mtx.Lock()
defer r.mtx.Unlock()
Expand All @@ -551,6 +558,8 @@ func (r *Consumer) DisconnectFromNSQD(addr string) error {
return nil
}

// DisconnectFromNSQLookupd removes the specified `nsqlookupd` address
// from the list used for periodic discovery.
func (r *Consumer) DisconnectFromNSQLookupd(addr string) error {
r.mtx.Lock()
defer r.mtx.Unlock()
Expand Down

0 comments on commit 796ccde

Please sign in to comment.