lib/goliath/deprecated/async_aroundware.rb
# Coordinates aroundware to process a request.
#
# We hook the aroundware in the middle of the async_callback chain:
# * send the downstream response to the aroundware, whether received directly
#   from @app.call or via async callback
# * have the upstream callback chain be invoked when the aroundware completes
#
# @param env [Goliath::Env] The goliath environment
# @return [Array] The [status_code, headers, body] tuple
Coordinates aroundware to process a request.
We hook the aroundware in the middle of the async_callback chain:
send the downstream response to the aroundware, whether received directly
from @app.call or via async callback
have the upstream callback chain be invoked when the aroundware completes
Coordinates aroundware to process a request . We hook the aroundware in the middle of the async_callback chain : send the downstream response to the aroundware whether received directly from @app . call or via async callback have the upstream callback chain be invoked when the aroundware completes
def call(env)
        aroundware = new_aroundware(env)
        aroundware_resp = aroundware.pre_process
        hook_into_callback_chain(env, aroundware)
        downstream_resp = @app.call(env)
        if final_response?(downstream_resp)
          aroundware.call(downstream_resp)
        end
        return Goliath::Connection::AsyncResponse
      end
def call ( env ) aroundware = new_aroundware ( env ) aroundware_resp = aroundware . pre_process hook_into_callback_chain ( env , aroundware ) downstream_resp = @app . call ( env ) if final_response? ( downstream_resp ) aroundware . call ( downstream_resp ) end return Goliath :: Connection :: AsyncResponse end
Coordinates aroundware to process a request.
Coordinates aroundware to process a request .
# if downstream resp is final, pass it to the aroundware; it will invoke # the callback chain at its leisure. Our response is *always* async.
The [status_code, headers, body] tuple
The [ status_code headers body ] tuple
Array
env
The goliath environment
The goliath environment