ostinelli / apnotic

A Ruby APNs HTTP/2 gem able to provide instant feedback.
MIT License
480 stars 96 forks source link

use httpx as the client backend #123

Open HoneyryderChuck opened 1 year ago

HoneyryderChuck commented 1 year ago

👋 I'd like to propose switching the HTTP backend to using httpx.

I was having a look at the outstanding issues, and it seems that most of them are related to error handling, the async API, and net-http2 lack of support for jruby. From a first look evaluation, I think that httpx could help fixing them: first, it supports jruby. It supports sending concurrent requests without relying on callbacks, which would replace the not obvious async API ans simplify the use case. Moreover, it can provide alternative ways of exposing errors without relying on callbacks.

It's also thread-safe, so you wouldn't need to support an alternative path based on connection-pool to enable it.

LMK what you think, I can help with implementing it.