From b96822f15c9ede2a0053afeb1a5f43d3df7d7d3d Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 30 Oct 2009 18:14:37 -0700 Subject: rev: split out heartbeat class This module will be reused in upcoming Rev-derived concurrency models. --- t/heartbeat-timeout.ru | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 t/heartbeat-timeout.ru (limited to 't/heartbeat-timeout.ru') diff --git a/t/heartbeat-timeout.ru b/t/heartbeat-timeout.ru new file mode 100644 index 0000000..fff0c40 --- /dev/null +++ b/t/heartbeat-timeout.ru @@ -0,0 +1,13 @@ +use Rack::ContentLength +fifo = ENV['FIFO_PATH'] or abort "FIFO_PATH not defined" +headers = { 'Content-Type' => 'text/plain' } +run lambda { |env| + case env['PATH_INFO'] + when "/block-forever" + # this should block forever (or until somebody opens it for reading) + File.open(fifo, "rb") { |fp| fp.syswrite("NEVER\n") } + [ 500, headers, [ "Should never get here\n" ] ] + else + [ 200, headers, [ "#$$\n" ] ] + end +} -- cgit v1.2.3-24-ge0c7