From 7da8f7696fafc22a50dbcded6ca44cad7ae32ab6 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 25 Nov 2009 10:18:02 -0800 Subject: add FiberPool concurrency model This is another Fiber-based concurrency model that can exploit a streaming "rack.input" for clients. Spawning Fibers seems pretty fast, but maybe there are apps that will benefit from this. --- t/GNUmakefile | 1 + t/simple-http_FiberPool.ru | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 t/simple-http_FiberPool.ru (limited to 't') diff --git a/t/GNUmakefile b/t/GNUmakefile index 359f300..934ce47 100644 --- a/t/GNUmakefile +++ b/t/GNUmakefile @@ -22,6 +22,7 @@ models := ThreadPool ThreadSpawn Rev EventMachine ifeq ($(RUBY_VERSION),1.9.1) # 1.9.2-preview1 was broken models += Revactor models += FiberSpawn + models += FiberPool # technically this works under 1.8, too, it's just slow models += RevThreadSpawn diff --git a/t/simple-http_FiberPool.ru b/t/simple-http_FiberPool.ru new file mode 100644 index 0000000..ae5b649 --- /dev/null +++ b/t/simple-http_FiberPool.ru @@ -0,0 +1,9 @@ +use Rack::ContentLength +use Rack::ContentType +run lambda { |env| + if env['rack.multithread'] == false && env['rainbows.model'] == :FiberPool + [ 200, {}, [ Thread.current.inspect << "\n" ] ] + else + raise "rack.multithread is not true" + end +} -- cgit v1.2.3-24-ge0c7