Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exposing underlying NATS conn #67

Closed
tylertreat-wf opened this issue Apr 28, 2016 · 3 comments
Closed

Exposing underlying NATS conn #67

tylertreat-wf opened this issue Apr 28, 2016 · 3 comments

Comments

@tylertreat-wf
Copy link

It would be nice if the STAN conn exposed a way to get the wrapped NATS conn. For example, if I have a STAN conn, I want to check if it's connected to NATS. Either STAN would need to have a Status() method which calls through to the NATS conn or we just allow you to get the NATS conn itself.

I see the potential dangers with this (e.g. closing the underlying NATS conn would be quite problematic), but if you are passing in your own NATS conn, this is already a possibility. And if STAN is creating the NATS conn for you, there's currently no way to check the NATS status.

@mcqueary
Copy link

This is an issue we have discussed internally. I don't remember all the salient issues, but I am sure @kozlovic or @ColinSullivan1 can refresh our memories. Think we were concerned about allowing manipulation of NATS options and callbacks, but I agree that at least Status() should be exposed.

@ColinSullivan1
Copy link
Member

@tylertreat @kozlovic @mcqueary I agree that Status() should be exposed. One can still create a NATS streaming connection passing a plain NATS connection - required today to setup TLS. IMO, since we do that, there isn't much more danger in providing, as "advanced" usage, an API that returns the underlying NATS connection. We'd need to thoroughly document the dangers though...

tylertreat added a commit to tylertreat/go-nats-streaming that referenced this issue Jun 29, 2016
Expose the underlying NATS conn status. Addresses nats-io#67.
tylertreat added a commit to tylertreat/go-nats-streaming that referenced this issue Jul 2, 2016
Add a NatsConn method to the Conn interface which allows retrieving the
underlying NATS Conn. Addresses nats-io#67.
@kozlovic
Copy link
Member

kozlovic commented Jul 7, 2016

Resolved with #86

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants