You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you're making a lot of requests, it makes sense to open one HTTP connection and reuse it for many requests. In net/http, one connection is reused if you call Net::HTTP.start with a block and make multiple requests inside that block, or if you create an instance using Net::HTTP.new.
I need to think about how the API for this should look, but for now I'm locally testing something like this:
classMiniskyattr_accessor:http_connectiondefmake_request(request)response=@http_connection.request(request)endendapi=Minisky.new('public.api.bsky.app',nil)Net::HTTP.start('public.api.bsky.app',443,use_ssl: true)do |http|
api.http_connection=http
... api.fetch_all ...
end
The text was updated successfully, but these errors were encountered:
If you're making a lot of requests, it makes sense to open one HTTP connection and reuse it for many requests. In
net/http
, one connection is reused if you callNet::HTTP.start
with a block and make multiple requests inside that block, or if you create an instance usingNet::HTTP.new
.I need to think about how the API for this should look, but for now I'm locally testing something like this:
The text was updated successfully, but these errors were encountered: