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

Function ExampleConn_QueueSubscribe

example_test.go:195–204  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

193}
194
195func ExampleConn_QueueSubscribe() {
196 nc, _ := nats.Connect(nats.DefaultURL)
197 defer nc.Close()
198
199 received := 0
200
201 nc.QueueSubscribe("foo", "worker_group", func(_ *nats.Msg) {
202 received++
203 })
204}
205
206func ExampleSubscription_AutoUnsubscribe() {
207 nc, _ := nats.Connect(nats.DefaultURL)

Callers

nothing calls this directly

Calls 3

ConnectMethod · 0.80
QueueSubscribeMethod · 0.65
CloseMethod · 0.45

Tested by

no test coverage detected