diff options
author | Eric Wong <e@80x24.org> | 2015-11-14 02:47:24 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2015-11-18 02:20:25 +0000 |
commit | 70c976bdd85bb8515fea01d6ad6074ef472fc2e0 (patch) | |
tree | 51230dc24bb183176b932e0d38e181869b5485e7 /lib/rainbows/event_machine/try_defer.rb | |
parent | 9c9e3949b2ef2f299ff1590d23aa4d053b60a2fd (diff) | |
download | rainbows-70c976bdd85bb8515fea01d6ad6074ef472fc2e0.tar.gz |
Unicorn 5 removes some constants we were using, and constant lookups + inline caching are waste of time anyways on newer Rubies with the opt_str_freeze bytecode instruction. This may reduce performance for folks on older Rubies (probably not noticeable); but improves performance for folks on newer Rubies.
Diffstat (limited to 'lib/rainbows/event_machine/try_defer.rb')
-rw-r--r-- | lib/rainbows/event_machine/try_defer.rb | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/rainbows/event_machine/try_defer.rb b/lib/rainbows/event_machine/try_defer.rb index 615adae..778f3d0 100644 --- a/lib/rainbows/event_machine/try_defer.rb +++ b/lib/rainbows/event_machine/try_defer.rb @@ -10,9 +10,6 @@ # See http://brainspl.at/articles/2008/04/18/deferred-requests-with-merb-ebb-and-thin # for more information. class Rainbows::EventMachine::TryDefer - # shortcuts - ASYNC_CALLBACK = Rainbows::EvCore::ASYNC_CALLBACK # :nodoc: - def initialize(app) # :nodoc: # the entire app becomes multithreaded, even the root (non-deferred) # thread since any thread can share processes with others @@ -22,7 +19,7 @@ class Rainbows::EventMachine::TryDefer def call(env) # :nodoc: if @app.deferred?(env) - EM.defer(proc { catch(:async) { @app.call(env) } }, env[ASYNC_CALLBACK]) + EM.defer(proc { catch(:async) { @app.call(env) } }, env['async.callback']) # all of the async/deferred stuff breaks Rack::Lint :< nil else |