You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I wanted to set the max number of Nats reconnections, at first, I noticed there is no clear way to tell Nats to try to reconnect to the Nats server forever.
After a few searches, I found out I could pass -1 to the nats.MaxReconnects to make it try to reconnect forever.
What is the proposed change?
There is no comment for the function nats.MaxReconnects, so if you want to find out how to make Nats try reconnections forever you have to google it and find the answer after a few searches.
I think it would be really nice to let the users know about this option in the comments because I think this a nice and important feature and would decrease confusion at first glance.
Another thing we can do is adding a new const for unlimited reconnections, like the nats.net library: public static int ReconnectForever = -1;.
What motivated this proposal?
When I wanted to set the max number of Nats reconnections, at first, I noticed there is no clear way to tell Nats to try to reconnect to the Nats server forever.
After a few searches, I found out I could pass
-1
to thenats.MaxReconnects
to make it try to reconnect forever.What is the proposed change?
There is no comment for the function
nats.MaxReconnects
, so if you want to find out how to make Nats try reconnections forever you have to google it and find the answer after a few searches.I think it would be really nice to let the users know about this option in the comments because I think this a nice and important feature and would decrease confusion at first glance.
Another thing we can do is adding a new const for unlimited reconnections, like the nats.net library:
public static int ReconnectForever = -1;
.The API would be something like this:
Who benefits from this change?
Confused people like me.
What alternatives have you evaluated?
No response
If this proposal is accepted I can submit a PR for that.
The text was updated successfully, but these errors were encountered: