diff --git a/nats.go b/nats.go index 2c42796cc..85c964b0a 100644 --- a/nats.go +++ b/nats.go @@ -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) }