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

Function ExampleConn_Request

example_test.go:185–193  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

183}
184
185func ExampleConn_Request() {
186 nc, _ := nats.Connect(nats.DefaultURL)
187 defer nc.Close()
188
189 nc.Subscribe("foo", func(m *nats.Msg) {
190 nc.Publish(m.Reply, []byte("I will help you"))
191 })
192 nc.Request("foo", []byte("help"), 50*time.Millisecond)
193}
194
195func ExampleConn_QueueSubscribe() {
196 nc, _ := nats.Connect(nats.DefaultURL)

Callers

nothing calls this directly

Calls 5

ConnectMethod · 0.80
SubscribeMethod · 0.65
PublishMethod · 0.65
CloseMethod · 0.45
RequestMethod · 0.45

Tested by

no test coverage detected