SpinGo / op-rabbit

The Opinionated RabbitMQ Library for Scala and Akka
Other
232 stars 73 forks source link

http: client connection pool with circuit breaker #102

Closed svezfaz closed 7 years ago

svezfaz commented 7 years ago

When using the low-level http client API, I would find convenient to have a circuit-breakable version of a client connection pool. In my specific case it would be for the superPool API, but the same could be applied to the cachedHostConnectionPool. It could be something like

def superPoolWithBreaker[T](breaker: CircuitBreaker)(...) = ???

Pool flows return Try[HttpResponse] already, so they can wrap the CB exceptions.

The CB could be wired in clientFlow helper method and used when the mapAsyncUnordered is invoked. I can take care of the PR in case this is deemed useful.

svezfaz commented 7 years ago

Just realised I opened this on the wrong project. Apologies for the massive oversight :)