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

Method Subscribe

js.go:97–97  ·  view source on GitHub ↗

Subscribe creates an async Subscription for JetStream. The stream and consumer names can be provided with the nats.Bind() option. For creating an ephemeral (where the consumer name is picked by the server), you can provide the stream name with nats.BindStream(). If no stream name is specified, the l

(subj string, cb MsgHandler, opts ...SubOpt)

Source from the content-addressed store, hash-verified

95 // consumer with the given name, and if successful, bind to it. If the lookup fails,
96 // then the Subscribe() call will return an error.
97 Subscribe(subj string, cb MsgHandler, opts ...SubOpt) (*Subscription, error)
98
99 // SubscribeSync creates a Subscription that can be used to process messages synchronously.
100 // See important note in Subscribe()

Callers 15

newAsyncReplyMethod · 0.65
WatchFilteredMethod · 0.65
GetMethod · 0.65
WatchMethod · 0.65
ExampleConn_SubscribeFunction · 0.65
ExampleConn_RequestFunction · 0.65
ExampleJetStreamFunction · 0.65
ExampleSubOptFunction · 0.65
TestClientTLSConfigFunction · 0.65

Calls

no outgoing calls

Tested by 15

ExampleConn_SubscribeFunction · 0.52
ExampleConn_RequestFunction · 0.52
ExampleJetStreamFunction · 0.52
ExampleSubOptFunction · 0.52
TestClientTLSConfigFunction · 0.52
TestClientCertificateFunction · 0.52
TestClosedConnectionsFunction · 0.52
TestCallbacksOrderFunction · 0.52