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

Function ExampleConn_PublishMsg

example_test.go:148–154  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

146}
147
148func ExampleConn_PublishMsg() {
149 nc, _ := nats.Connect(nats.DefaultURL)
150 defer nc.Close()
151
152 msg := &nats.Msg{Subject: "foo", Reply: "bar", Data: []byte("Hello World!")}
153 nc.PublishMsg(msg)
154}
155
156func ExampleConn_Flush() {
157 nc, _ := nats.Connect(nats.DefaultURL)

Callers

nothing calls this directly

Calls 3

ConnectMethod · 0.80
PublishMsgMethod · 0.65
CloseMethod · 0.45

Tested by

no test coverage detected