def send_item_using_eventmachine(item, uri)
      body = item.dump
      return unless body

      headers = { 'X-Rollbar-Access-Token' => item['access_token'] }
      options = http_proxy_for_em(uri)
      req = EventMachine::HttpRequest.new(uri.to_s, options).post(:body => body, :head => headers)

      req.callback do
        if req.response_header.status == 200
          log_info '[Rollbar] Success'
        else
          log_warning "[Rollbar] Got unexpected status code from Rollbar.io api: #{req.response_header.status}"
          log_info "[Rollbar] Response: #{req.response}"
        end
      end

      req.errback do
        log_warning "[Rollbar] Call to API failed, status code: #{req.response_header.status}"
        log_info "[Rollbar] Error's response: #{req.response}"
      end
    end
def send_item_using_eventmachine(item, uri)
      body = item.dump
      return unless body

      headers = { 'X-Rollbar-Access-Token' => item['access_token'] }
      options = http_proxy_for_em(uri)
      req = EventMachine::HttpRequest.new(uri.to_s, options).post(:body => body, :head => headers)

      req.callback do
        if req.response_header.status == 200
          log_info '[Rollbar] Success'
        else
          log_warning "[Rollbar] Got unexpected status code from Rollbar.io api: #{req.response_header.status}"
          log_info "[Rollbar] Response: #{req.response}"
        end
      end

      req.errback do
        log_warning "[Rollbar] Call to API failed, status code: #{req.response_header.status}"
        log_info "[Rollbar] Error's response: #{req.response}"
      end
    end
Delivery functions