Skip to content

Commit

Permalink
Merge pull request #886 from ipromax/fix-comment
Browse files Browse the repository at this point in the history
Extended comment for Subscribe method
  • Loading branch information
kozlovic committed Jan 20, 2022
2 parents 4db0fb0 + d2b3332 commit 5702db7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions nats.go
Expand Up @@ -3738,8 +3738,13 @@ func (nc *Conn) respToken(respInbox string) string {
}

// Subscribe will express interest in the given subject. The subject
// can have wildcards (partial:*, full:>). Messages will be delivered
// to the associated MsgHandler.
// can have wildcards.
// There are two type of wildcards: * for partial, and > for full.
// A subscription on subject time.*.east would receive messages sent to time.us.east and time.eu.east.
// A subscription on subject time.us.> would receive messages sent to
// time.us.east and time.us.east.atlanta, while time.us.* would only match time.us.east
// since it can't match more than one token.
// Messages will be delivered to the associated MsgHandler.
func (nc *Conn) Subscribe(subj string, cb MsgHandler) (*Subscription, error) {
return nc.subscribe(subj, _EMPTY_, cb, nil, false, nil)
}
Expand Down

0 comments on commit 5702db7

Please sign in to comment.