AndrewBarba / apns2

Node client for connecting to Apple's Push Notification Service using the new HTTP/2 protocol with JSON web tokens
MIT License
118 stars 32 forks source link

Cannot close open connections in 11.1.0 #57

Closed edonosotti closed 1 year ago

edonosotti commented 1 year ago

The suggestions from #29 no longer work in 11.1.0.

client.destroy() throws error TypeError: client.destroy is not a function.

client._clients.destroy() throws error TypeError: Cannot read properties of undefined (reading 'destroy').

The README file briefly mentions closing clients ("Once a client is closed you will not be able to use it again."), but no further information is given.

AndrewBarba commented 1 year ago

Hey @edonosotti I'm sorry for the delay here. v11 switches the underlying http client to fetch-http2 which does not use a connection pool anymore so there isn't anything to close / destroy. I will update the readme.

AndrewBarba commented 1 year ago

Sorry I have to close this due to other spam. Please re-open as needed with questions / concerns.