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

Function ExampleSubscription_Unsubscribe

example_test.go:132–139  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

130}
131
132func ExampleSubscription_Unsubscribe() {
133 nc, _ := nats.Connect(nats.DefaultURL)
134 defer nc.Close()
135
136 sub, _ := nc.SubscribeSync("foo")
137 // ...
138 sub.Unsubscribe()
139}
140
141func ExampleConn_Publish() {
142 nc, _ := nats.Connect(nats.DefaultURL)

Callers

nothing calls this directly

Calls 4

ConnectMethod · 0.80
UnsubscribeMethod · 0.80
SubscribeSyncMethod · 0.65
CloseMethod · 0.45

Tested by

no test coverage detected