Skip to content

Commit

Permalink
Added deprecation notice for NatsConn()
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Kozlovic <[email protected]>
  • Loading branch information
kozlovic committed Jul 28, 2021
1 parent 7eef3e7 commit a53d804
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions stan.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ type Options struct {
// the NATS streaming connection does NOT close this NATS connection.
// It is the responsibility of the application to manage the lifetime of
// the supplied NATS connection.
//
// DEPRECATED: Users should provide NATS options through NatsOptions()
// instead to configure the underlying NATS connection.
NatsConn *nats.Conn

// NatsOptions is an array of NATS options to configure the NATS connection
Expand Down Expand Up @@ -251,6 +254,9 @@ func MaxPubAcksInflight(max int) Option {
// NatsConn is an Option to set the underlying NATS connection to be used
// by a streaming connection object. When such option is set, closing the
// streaming connection does not close the provided NATS connection.
//
// DEPRECATED: Users should use NatsOptions instead to configure the
// underlying NATS Connection created by the Streaming connection.
func NatsConn(nc *nats.Conn) Option {
return func(o *Options) error {
o.NatsConn = nc
Expand Down

0 comments on commit a53d804

Please sign in to comment.