semian icon indicating copy to clipboard operation
semian copied to clipboard

How do I use Semian (for dummies)

Open bsandeepan opened this issue 2 years ago • 0 comments

I am having trouble to understand how to use the Semian gem to implement a circuit breaker around a HTTP call. I went through the README multiple times. As far as I understand, I need to use the NetHTTP adapter, but where do I put the code?

The HTTP urls I want to wrap in circuit breaker are in separate models like the following:

class Demo
  def call_service_1 do
    return Net::HTTP.get_response("service1_url.com").body
  end

I have multiple models like these calling service 1, 2, 3 etc. I just want to enable circuit breaker for the Urls, and not turn the whole classes to adapters. How can I achieve this?

Note: I am new to Ruby, so maybe you need to give me some more context.

bsandeepan avatar Apr 22 '22 14:04 bsandeepan