lib/sync-defer.rb
# assume we would always require 'rest-core' in root fiber
assume we would always require 'rest-core' in root fiber
assume we would always require ' rest - core ' in root fiber
def defer *args, &block
    if fiber_wrapped?
      if Object.const_defined?(:EventMachine) &&
         EventMachine.reactor_running?
        EventMachine::SyncDefer.defer(*args, &block)
      elsif Object.const_defined?(:Coolio) &&
            Coolio::Loop.default.has_active_watchers?
        Coolio::SyncDefer.defer(*args, &block)
      else
        fallback("No reactor found.", *args, block)
      end
    else
      fallback("Not called inside a fiber.", *args, &block)
    end
  end
def defer * args , & block if fiber_wrapped? if Object . const_defined? ( :EventMachine ) && EventMachine . reactor_running? EventMachine :: SyncDefer . defer ( * args , & block ) elsif Object . const_defined? ( :Coolio ) && Coolio :: Loop . default . has_active_watchers? Coolio :: SyncDefer . defer ( * args , & block ) else fallback ( "No reactor found." , * args , block ) end else fallback ( "Not called inside a fiber." , * args , & block ) end end
assume we would always require 'rest-core' in root fiber
assume we would always require ' rest - core ' in root fiber
args
<not_specific>
block
<not_specific>