Monitoring HTTP
Reported by bahuvrihi | November 24th, 2008 @ 04:08 PM
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
Comments and changes to this ticket
-
bahuvrihi March 6th, 2009 @ 03:24 PM
- State changed from new to resolved
- Assigned user set to bahuvrihi
(from [b97e3fc757afbedacff7a8b0ca486bb3088daee2]) added Monitor for long-running http requests [#2 state:resolved responsible:bahuvrihi] http://github.com/bahuvrihi/tap-...
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.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป