I can't find the place where Active Resource initiates its connections. I was expecting Connection.request to call into a networking library, but instead it merely calls into ActiveSupport::Notifications.instrument, which appears to be some kind of messaging service.
Does anybody know how this is working? I couldn't find the code that was listening for the message. ActiveSupport::Notifications is completely new to me, so perhaps there's an obvious place that the listener would be located.
def request(method, path, *arguments)
result = ActiveSupport::Notifications.instrument("request.active_resource") do |payload|
payload[:method] = method
payload[:request_uri] = "#{site.scheme}://#{site.host}:#{site.port}#{path}"
payload[:result] = http.send(method, path, *arguments)
end
The method definition is here on GitHub