question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Publisher Client `close()` method

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
bcoecommented, Dec 26, 2019

@merlinnot just added to the schedule for our next library group meeting; @feywind probably worth having this on your radar 👍

1reaction
merlinnotcommented, Feb 4, 2020

@feywind Some edge cases were discussed in this thread: https://github.com/grpc/grpc-node/pull/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 close method is strictly necessary and there’s no way around it. That’s why a patch was made to @grpc/grpc-js, then googleapis/gapic-generator-typescript and then googleapis/nodejs-firestore.

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Class Client (2.13.11) | Python client library
If called after publisher has been stopped by a stop() method call. ValueError, If the topic/ordering key combination has not been seen before ......
Read more >
Document.Close method (Publisher)
Use the Close method only on an open Document object in another instance of Microsoft Publisher. Attempting to close the active publication ...
Read more >
Closing Google Cloud PubSub client with future running
I'm not seeing any way to get the client from the future, and the callback add_done_callback doesn't (right so) doesn't allow to send...
Read more >
publish - Google Cloud
No information is available for this page.
Read more >
Class MqttClient
Lightweight client for talking to an MQTT server using methods that block until an operation completes. ... public void disconnect() throws MqttException.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found