Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Monitoring HTTP

#2

This is a snippet I pulled from tap-http. It is from an older library, Prosperity. Basically this shows where to hook into the Net::BufferedIO to monitor the progress of an HTTP request that sends updates.

Ignore the Acts::Monitorable and observe where its tick_monitor method is used.


module Net
  class HTTP
    attr_reader :socket
  end

  class BufferedIO
    include Prosperity::Acts::Monitorable

    private

    def rbuf_fill
      tick_monitor
      timeout(@read_timeout) {
        @rbuf << @io.sysread(1024)
      }
    end
  end
end

Reported by bahuvrihi · November 24th, 2008 @ 04:08 PM

State: resolved
Milestone: none
Assigned to: bahuvrihi bahuvrihi

Activity

  1. bahuvrihi
    bahuvrihi
    • State changed from new to resolved
    • Assigned user set to bahuvrihi

    (from [b97e3fc757afbedacff7a8b0ca486bb3088daee2]) added Monitor for long-running http requests [#2 Monitoring HTTP state:resolved responsible:bahuvrihi] http://github.com/bahuvrihi/tap-...

    March 6th, 2009 @ 03:24 PM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.