From ef66567984780b2ce8daa155c367bcf7e049ab77 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 27 Dec 2010 23:25:12 +0000 Subject: coolio*: favor Coolio over Rev We still use and define Rev internally, but that's mostly just manual labor of converting stuff over. --- Documentation/comparison.haml | 41 ++++++++++++++++++++--------------------- README | 14 +++++++------- lib/rainbows/coolio_support.rb | 10 ++++++++++ lib/rainbows/fiber/rev.rb | 7 +------ lib/rainbows/rev.rb | 10 +--------- t/GNUmakefile | 4 ---- 6 files changed, 39 insertions(+), 47 deletions(-) create mode 100644 lib/rainbows/coolio_support.rb diff --git a/Documentation/comparison.haml b/Documentation/comparison.haml index 5801782..89b5d4b 100644 --- a/Documentation/comparison.haml +++ b/Documentation/comparison.haml @@ -35,7 +35,7 @@ %td.rbx Yes %td.slow OK %tr.comp_row - %td.mod Rev + %td.mod Coolio %td.tee No %td.r18 Yes %td.r19 Yes @@ -56,7 +56,7 @@ %td.rbx No %td.slow Yes %tr.comp_row - %td.mod RevThreadSpawn + %td.mod CoolioThreadSpawn %td.tee No %td.r18 No %td.r19 Yes @@ -91,14 +91,14 @@ %td.rbx No %td.slow Yes %tr.comp_row - %td.mod RevThreadPool + %td.mod CoolioThreadPool %td.tee No %td.r18 Yes %td.r19 No %td.rbx No %td.slow Yes %tr.comp_row - %td.mod RevFiberSpawn + %td.mod CoolioFiberSpawn %td.tee Yes %td.r18 No %td.r19 Yes @@ -120,10 +120,9 @@ %td.slow no %ul %li - All Rev-based options can also use "Coolio" instead. Cool.io should - also work with Rubinius (though we haven't had time to test). + Cool.io should also work with Rubinius (though we haven't had time to test). %li - CoolioThread* and RevThread* requires Ruby 1.9 reasonable performance + CoolioThread* and CoolioThread* requires Ruby 1.9 reasonable performance %li rack.input streaming is what makes %a(href="http://upr.bogomips.org/") upload progress, @@ -150,7 +149,7 @@ %tr.comp_row %td.mod Revactor %td.slowio - %a(href="http://rev.rubyforge.org/")Rev, + %a(href="http://coolio.github.com/")Coolio, %a(href="http://revactor.org/")Revactor, %b not @@ -163,9 +162,9 @@ %td.thr Yes %td.reent No %tr.comp_row - %td.mod Rev + %td.mod Coolio %td.slowio - %a(href="http://rev.rubyforge.org/") Rev + %a(href="http://coolio.github.com/") Coolio %td.thr No %td.reent No %tr.comp_row @@ -180,10 +179,10 @@ %td.thr No %td.reent No %tr.comp_row - %td.mod RevThreadSpawn + %td.mod CoolioThreadSpawn %td.slowio thread-safe Ruby, - %a(href="http://rev.rubyforge.org/") Rev + %a(href="http://coolio.github.com/") Coolio %td.thr Yes %td.reent No %tr.comp_row @@ -211,14 +210,14 @@ %td.thr No %td.reent Yes %tr.comp_row - %td.mod RevThreadPool + %td.mod CoolioThreadPool %td.slowio thread-safe Ruby, - %a(href="http://rev.rubyforge.org/") Rev + %a(href="http://coolio.github.com/") Coolio %td.thr Yes %td.reent No %tr.comp_row - %td.mod RevFiberSpawn + %td.mod CoolioFiberSpawn %td.slowio %a(href="Rainbows/Fiber/IO.html") Rainbows::Fiber::IO %td.thr No @@ -288,7 +287,7 @@ %td.async standard Ruby %td.ws Sunshowers %tr.comp_row - %td.mod Rev + %td.mod Coolio %td.devfd Yes %td.app_pool no-op %td.lock no-op @@ -309,7 +308,7 @@ %td.async async_sinatra, Cramp, rack-fiber_pool %td.ws no %tr.comp_row - %td.mod RevThreadSpawn + %td.mod CoolioThreadSpawn %td.devfd Yes %td.app_pool Yes %td.lock Dumb @@ -344,18 +343,18 @@ %td.async NeverBlock, async_sinatra %td.ws no %tr.comp_row - %td.mod RevThreadPool + %td.mod CoolioThreadPool %td.devfd Yes %td.app_pool Yes %td.lock Dumb - %td.async Rev, standard Ruby + %td.async Coolio, standard Ruby %td.ws no %tr.comp_row - %td.mod RevFiberSpawn + %td.mod CoolioFiberSpawn %td.devfd Yes %td.app_pool Yes %td.lock No! - %td.async Rev, Rainbows::Fiber::IO, Rainbows.sleep + %td.async Coolio, Rainbows::Fiber::IO, Rainbows.sleep %tr.comp_row %td.mod WriterThreadPool %td.devfd Yes diff --git a/README b/README index 06696fb..e921205 100644 --- a/README +++ b/README @@ -21,19 +21,19 @@ suck; differently. For network concurrency, models we currently support are: -* {RevFiberSpawn}[link:Rainbows/RevFiberSpawn.html] -* {Revactor}[link:Rainbows/Revactor.html] -* {ThreadPool}[link:Rainbows/ThreadPool.html] -* {Rev}[link:Rainbows/Rev.html] -* {ThreadSpawn}[link:Rainbows/ThreadSpawn.html] +* {Coolio}[link:Rainbows/Coolio.html] * {EventMachine}[link:Rainbows/EventMachine.html] -* {RevThreadSpawn}[link:Rainbows/RevThreadSpawn.html] * {FiberSpawn}[link:Rainbows/FiberSpawn.html] * {FiberPool}[link:Rainbows/FiberPool.html] * {NeverBlock}[link:Rainbows/NeverBlock.html] -* {RevThreadPool}[link:Rainbows/RevThreadPool.html] +* {Revactor}[link:Rainbows/Revactor.html] +* {ThreadPool}[link:Rainbows/ThreadPool.html] +* {ThreadSpawn}[link:Rainbows/ThreadSpawn.html] * {WriterThreadPool}[link:Rainbows/WriterThreadPool.html] * {WriterThreadSpawn}[link:Rainbows/WriterThreadSpawn.html] +* {CoolioFiberSpawn}[link:Rainbows/CoolioFiberSpawn.html] +* {CoolioThreadPool}[link:Rainbows/CoolioThreadPool.html] +* {CoolioThreadSpawn}[link:Rainbows/CoolioThreadSpawn.html] We have {many more on the way}[link:TODO.html] for handling network concurrency. Additionally, we also use multiple processes (managed by diff --git a/lib/rainbows/coolio_support.rb b/lib/rainbows/coolio_support.rb new file mode 100644 index 0000000..d345395 --- /dev/null +++ b/lib/rainbows/coolio_support.rb @@ -0,0 +1,10 @@ +# -*- encoding: binary -*- +# :enddoc: +begin + require "coolio" + Coolio::VERSION >= "1.0.0" or abort "cool.io >= 1.0.0 is required" + Rev = Coolio +rescue LoadError + require "rev" + Rev::VERSION >= "0.3.0" or abort "rev >= 0.3.0 is required" +end diff --git a/lib/rainbows/fiber/rev.rb b/lib/rainbows/fiber/rev.rb index cf70367..00e439e 100644 --- a/lib/rainbows/fiber/rev.rb +++ b/lib/rainbows/fiber/rev.rb @@ -1,11 +1,6 @@ # -*- encoding: binary -*- # :enddoc: -begin - require 'coolio' -rescue LoadError - require 'rev' -end -require 'rev' if defined?(Coolio) +require 'rainbows/coolio_support' require 'rainbows/fiber' require 'rainbows/fiber/io' diff --git a/lib/rainbows/rev.rb b/lib/rainbows/rev.rb index 1e425fe..16d00aa 100644 --- a/lib/rainbows/rev.rb +++ b/lib/rainbows/rev.rb @@ -1,13 +1,5 @@ # -*- encoding: binary -*- -begin - require 'coolio' - Coolio::VERSION >= '1.0.0' or abort 'cool.io >= 1.0.0 is required' -rescue LoadError - require 'rev' - Rev::VERSION >= '0.3.0' or abort 'rev >= 0.3.0 is required' -end -require 'rev' if defined?(Coolio) - +require 'rainbows/coolio_support' # Coolio is the new version of this, use that instead. # # Implements a basic single-threaded event model with diff --git a/t/GNUmakefile b/t/GNUmakefile index 0084f3d..91e05f5 100644 --- a/t/GNUmakefile +++ b/t/GNUmakefile @@ -23,7 +23,6 @@ models += WriterThreadPool models += WriterThreadSpawn models += ThreadPool models += ThreadSpawn -models += Rev models += Coolio models += EventMachine models += NeverBlock @@ -35,9 +34,6 @@ ifeq ($(RUBY_ENGINE),ruby) models += Revactor models += FiberSpawn models += FiberPool - models += RevThreadPool - models += RevThreadSpawn - models += RevFiberSpawn models += CoolioThreadPool models += CoolioThreadSpawn models += CoolioFiberSpawn -- cgit v1.2.3-24-ge0c7