-
Notifications
You must be signed in to change notification settings - Fork 227
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
Publisher Client close()
method
#817
Comments
This is a great feature request, I'd benefit from it too. There's a similar FR against Firestore: googleapis/nodejs-firestore#769 |
@bcoe @callmehiphop It was now implemented in the Firestore client and I got impressive gains thanks to it, see googleapis/nodejs-firestore#769 (comment). Is there a chance to prioritize this feature somehow? I have the exact same issue with PubSub, as I had with Firestore. |
@merlinnot just added to the schedule for our next library group meeting; @feywind probably worth having this on your radar 👍 |
Good to hear this will be discussed! For the record/in case it's pertinent I read over the issue @merlinnot linked to for firestore, and we face exactly the same problem (although he described it better than I!) |
@bcoe Did the meeting happen already? |
@merlinnot @colmsnowplow It's been discussed a couple of times. I haven't heard a super definite "yay do it", but I think the consensus is that we're planning to do it. Basically that it probably shouldn't be necessary to use a close() method, but that it will still probably help people for now. It's behind another fire or two though :) |
@feywind Some edge cases were discussed in this thread: grpc/grpc-node#1083. It's quite lengthy, but it took quite some time to get to a common understanding. Bottom line: there are some scenarios where having a While I do acknowledge and understand that this is not necessary in most of the scenarios, power users do and will always require it for more advanced scenarios. |
Potentially related: #725 (for the subscriber side) |
Is your feature request related to a problem? Please describe.
There's currently no method to close a client. I'm using the client in a persistent environment, which isn't guaranteed to be actively processing data at any given time.
If there's a delay between messages, there's a chance that the network connection fails to resolve, eg. if the connection is closed on the server side but not client side.
In order to cover this, I need to open a new connection and I have no way to close the stale one, so basically this eventually leads to a proliferation of open but unused sockets.
Describe the solution you'd like
A
client.close()
method which allows me to terminate a client connection client-side.Describe alternatives you've considered
Manually closing sockets or terminating the entire environment every time we hit a stale connection are the only real options I can see - neither are desirable for obvious reasons.
The text was updated successfully, but these errors were encountered: