MCPcopy
hub / github.com/nats-io/nats.go / Subscribe

Method Subscribe

nats.go:4797–4799  ·  view source on GitHub ↗

Subscribe will express interest in the given subject. The subject 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

(subj string, cb MsgHandler)

Source from the content-addressed store, hash-verified

4795// since it can't match more than one token.
4796// Messages will be delivered to the associated MsgHandler.
4797func (nc *Conn) Subscribe(subj string, cb MsgHandler) (*Subscription, error) {
4798 return nc.subscribe(subj, _EMPTY_, cb, nil, nil, false, nil)
4799}
4800
4801// ChanSubscribe will express interest in the given subject and place
4802// all messages received on the channel.

Callers 1

TestNilConnectionFunction · 0.95

Calls 1

subscribeMethod · 0.95

Tested by 1

TestNilConnectionFunction · 0.76