From 7f11b212f78a5070bea17bc20af43395b6cc621d Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 25 Nov 2009 15:08:25 -0800 Subject: Fiber*: add Rainbows::Fiber.sleep method It works exactly like Actor.sleep and similar to Kernel.sleep (no way to sleep indefinitely), but is compatible with the IO.select-based Fiber scheduler we run. This method only works within the context of a Rainbows! application dispatch. --- t/sleep.ru | 2 ++ 1 file changed, 2 insertions(+) (limited to 't/sleep.ru') diff --git a/t/sleep.ru b/t/sleep.ru index 9e4eff1..2df22ce 100644 --- a/t/sleep.ru +++ b/t/sleep.ru @@ -8,6 +8,8 @@ run lambda { |env| env["PATH_INFO"] =~ %r{/([\d\.]+)\z} and nr = $1.to_f (case env['rainbows.model'] + when :FiberPool, :FiberSpawn + Rainbows::Fiber when :Revactor Actor else -- cgit v1.2.3-24-ge0c7