nodejs/http2

http2: Document Best Practices for Module Authors

AndrewBarba opened this issue · 1 comments

More of a question than an issue, but do you guys intend to document best practices in the docs section for http2? I have a library that connects to Apple's push notification h2 api and I'm converting it to use h2 in core. Currently unit tests are passing against master nodejs/http2 but somethings are unclear regarding best practices. For example, best practices around destroying the h2 client, do you recommend keeping it around if we expect multiple requests to same host/port? Destroying after certain amount of time? For concurrency is it recommended to have a pool of h2 clients connecting to same host/port? Etc.

If this isn't the place for that feel free to close, I can follow up on Stack overflow at a later time.

Yes, as much as possible. The most difficult and challenging task for us right now and going forward will be to define what the APIs actually need to be from a usability standpoint and what those best practices should be. For instance, right now we have to close the client connection manually because we have no way of knowing when the user will be done with it. We can get around that, potentially, by unref()ing the connection on creation, ensure that it will not keep the Node.js process open. It's something we can do but is it something we should do... that's still an open question.

Given that, I'd like to reverse this a bit... given your experience converting code over to using this... we'd love to hear your feedback and recommendations on what the best practices should be or what your thoughts are on using the API as it currently exists.