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. --- lib/rainbows/fiber_spawn.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/rainbows/fiber_spawn.rb') diff --git a/lib/rainbows/fiber_spawn.rb b/lib/rainbows/fiber_spawn.rb index 969c05b..004976a 100644 --- a/lib/rainbows/fiber_spawn.rb +++ b/lib/rainbows/fiber_spawn.rb @@ -23,7 +23,7 @@ module Rainbows begin ret = begin - IO.select(rd.keys.concat(LISTENERS), wr.keys, nil, 1) or next + IO.select(rd.keys.concat(LISTENERS), wr.keys, nil, timer) or next rescue Errno::EINTR G.tick retry -- cgit v1.2.3-24-ge0c7