Thread Safety

Because pools are thread-local, any call from a session will be thread-safe.

# 4 separate connections in different pools
4.times.map do |i|
  Thread.start { HTTPX.get("https://example.com/#{i}") }
end.join

# same session, different pools
http = HTTPX.accept("application/json")
4.times.map do |i|
  Thread.start { http.get("https://example.com/#{i}") }
end.join

Next: Debugging