net-http2
net-http2 copied to clipboard
Consider add a block version of Client.new?
It would self-close by calling #close in an ensure block (ensure is important!) after the block param is finished.
NetHttp2::Client.new("http://106.186.112.116") do
client.get something
client.post something
end
Or doc that if it already exists. :)
This issue was opened before NetHttp2 had async calls too.
If a block generates a client, you would expect to be able to use all the features of a client, and I don't really see how you wold use this block to perform async calls too (since something needs to block to wait for async replies).
What is your opinion on this?