Module: AsyncRack::AsyncCallback::Mixin

Extended by:
LateInitializer
Included in:
SimpleWrapper
Defined in:
lib/async_rack/async_callback.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from LateInitializer

included

Instance Attribute Details

#envObject

Returns the value of attribute env.



99
100
101
# File 'lib/async_rack/async_callback.rb', line 99

def env
  @env
end

Instance Method Details

#async_callback(result) ⇒ Object



101
102
103
# File 'lib/async_rack/async_callback.rb', line 101

def async_callback(result)
  @async_callback.call result
end

#call(env) ⇒ Object



112
113
114
115
# File 'lib/async_rack/async_callback.rb', line 112

def call(env)
  setup_async env
  super
end

#setup_async(env) ⇒ Object



105
106
107
108
109
110
# File 'lib/async_rack/async_callback.rb', line 105

def setup_async(env)
  return false if @async_callback
  @async_callback = env['async.callback']
  env['async.callback'] = method :async_callback
  @env = env
end