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

Method Publish

enc.go:105–111  ·  view source on GitHub ↗

Publish publishes the data argument to the given subject. The data argument will be encoded using the associated encoder. Deprecated: Encoded connections are no longer supported.

(subject string, v any)

Source from the content-addressed store, hash-verified

103//
104// Deprecated: Encoded connections are no longer supported.
105func (c *EncodedConn) Publish(subject string, v any) error {
106 b, err := c.Enc.Encode(subject, v)
107 if err != nil {
108 return err
109 }
110 return c.Conn.publish(subject, _EMPTY_, false, nil, b)
111}
112
113// PublishRequest will perform a Publish() expecting a response on the
114// reply subject. Use Request() for automatically waiting for a response

Calls 2

publishMethod · 0.80
EncodeMethod · 0.65