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

Method Publish

jetstream/publish.go:161–163  ·  view source on GitHub ↗

Publish performs a synchronous publish to a stream and waits for ack from server. It accepts subject name (which must be bound to a stream) and message payload.

(ctx context.Context, subj string, data []byte, opts ...PublishOpt)

Source from the content-addressed store, hash-verified

159// from server. It accepts subject name (which must be bound to a stream)
160// and message payload.
161func (js *jetStream) Publish(ctx context.Context, subj string, data []byte, opts ...PublishOpt) (*PubAck, error) {
162 return js.PublishMsg(ctx, &nats.Msg{Subject: subj, Data: data}, opts...)
163}
164
165// PublishMsg performs a synchronous publish to a stream and waits for
166// ack from server. It accepts subject name (which must be bound to a

Callers

nothing calls this directly

Calls 1

PublishMsgMethod · 0.95

Tested by

no test coverage detected