In the past I have used Net::HTTP to call trivial remote services.
These calls have been low frequency so didn’t bother looking into
alternatives.
I’m now looking at a design where I will be calling a remote service
that returns a simple CSV but it will be called frequently and if that
service goes down I need to degrade gracefully. I’d like to punt if
the web service fails to respond in 1 second (500 ms may be better).
In the past I have used Net::HTTP to call trivial remote services.
These calls have been low frequency so didn’t bother looking into
alternatives.
I’m now looking at a design where I will be calling a remote service
that returns a simple CSV but it will be called frequently and if that
service goes down I need to degrade gracefully. I’d like to punt if
the web service fails to respond in 1 second (500 ms may be better).
It looks like HTTParty uses Net::HTTP so I’ll just stick with that.
Stick with which?
I got burned by so many deprecated gems moving from Rails 2 to Rails 3
that use them sparingly now. :-\
I see this attitude a lot, and I believe it is silly. If there’s
already a library out there that makes your life easier, don’t reinvent
the wheel. Laziness is one of the cardinal virtues for programmers!
It looks like HTTParty uses Net::HTTP so I’ll just stick with that.
Stick with which?
I’ll just call Net::HTTP directly. I have a simple GET request that
returns some simple CSV data.
I got burned by so many deprecated gems moving from Rails 2 to Rails 3
that use them sparingly now. :-\
I see this attitude a lot, and I believe it is silly. If there’s
already a library out there that makes your life easier, don’t reinvent
the wheel. Laziness is one of the cardinal virtues for programmers!
I’m not really reinventing the wheel here. HTTParty is fine but I
just wanted a connection timeout via Net::HTTP, which I learned how to
do by looking at HTTParty code.
If a 1000 line gem is saving me 10 lines of code I’m better off not
using it.
Gems like authlogic are essential. If I needed more HTTParty features
I would use it but for now the standard library is just fine.