Pre-response callback handler.
962040
def _server_begin_response_callback(self, response: Response):
        ''''''
        self._item_session.response = response

        if self._cookie_jar:
            self._cookie_jar.extract_cookies(response, self._item_session.request)

        action = self._result_rule.handle_pre_response(self._item_session)
        self._file_writer_session.process_response(response)

        return action == Actions.NORMAL
1204552
function(err, data, response) {

				// call the 'response' callback, if provided using 'node' style callback pattern
				if (options.complete) {
					options.complete.call(model, err, data, response, options);
				}

				// trigger any event listeners for "complete"
				model.trigger('complete', err, data, response, options);
			}
1295755
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
		final HandlerLocation location = new HandlerLocation(request, handler, HandlerStep.CONTROLLER);
		threadLocation.set(location);

		// Start controller stopwatch
		startStopwatch(location);
		return true;
	}
533429
def handler(self, reply):
        """"""
        data = reply.data
        while len(data):
            event, data = rq.EventField(None).parse_binary_value(data, self.display.display, None, None)
            if self.escape(event):  # Quit if this returns True
                self.stop()
            else:
                self._tap(event)
320899
def make_response(obj):
    """"""
    if obj is None:
        raise TypeError("Handler return value cannot be None.")
    if isinstance(obj, Response):
        return obj
    return Response(200, body=obj)
1368831
async def handler(event):
    """"""
    await asyncio.wait([
        event.delete(),
        event.respond(OFFTOPIC[event.chat_id], reply_to=event.reply_to_msg_id)
    ])
497187
function setBeforeRouteChangeHandler(handler) {
            if (null == handler) {
                return _beforeRouteChange;
            }
            else {
                var oldHandler = _beforeRouteChange;
                _beforeRouteChange = handler;
                return oldHandler;
            }
        }
116406
function () {

            var res = arguments[0];

            userOptions.emit('response', req, res);

            if (callback && userOptions.resCallback) callback.apply(this, arguments);

            res.on('end', function() {
                userOptions.emit('afterResponse', req, res);
            });

        }
1061044
def CallApiHandler(handler, args, token=None):
    """"""

    result = handler.Handle(args, token=token)

    expected_type = handler.result_type
    if expected_type is None:
      expected_type = None.__class__

    if result.__class__ != expected_type:
      raise UnexpectedResultTypeError(
          "Expected %s, but got %s." %
          (expected_type.__name__, result.__class__.__name__))

    return result
727737
def start_response_callback(start_response, transaction_id):
        """"""
        def callback(status, headers, exc_info=None):
            """Add our headers to response using a closure."""
            headers.append(('X-Transaction-Id', transaction_id))
            # Call upstream start_response
            start_response(status, headers, exc_info)
        return callback
1151833
function handleCallback(err, url, callback) {
	if (callback.__called) {
		return;
	}
	callback.__called = true;
	callback(err, {
		url: url,
		title: callback.__title,
		count: callback.__redirectCounter,
		tracks: callback.__tracks
	});
}
337647
def state_callback(before_or_after = :before)
      method_name = :"#{before_or_after}_#{@order.state}"
      send(method_name) if respond_to?(method_name, true)
    end
986094
def _on_request(self, name, args):
        """"""
        if IS_PYTHON3:
            name = decode_if_bytes(name)
        handler = self._request_handlers.get(name, None)
        if not handler:
            msg = self._missing_handler_error(name, 'request')
            error(msg)
            raise ErrorResponse(msg)

        debug('calling request handler for "%s", args: "%s"', name, args)
        rv = handler(*args)
        debug("request handler for '%s %s' returns: %s", name, args, rv)
        return rv
243231
def prepare(self):
		""""""
		self.scope = 0
		self.mapping = deque([0])
		self._handler = [i() for i in sorted(self.handlers, key=lambda handler: handler.priority)]
742080
def handle_pre_response(self, item_session: ItemSession) -> Actions:
        ''''''
        action = self.consult_pre_response_hook(item_session)

        if action == Actions.RETRY:
            item_session.set_status(Status.skipped)
        elif action == Actions.FINISH:
            item_session.set_status(Status.done)
        elif action == Actions.STOP:
            raise HookStop('Script requested immediate stop.')

        return action
81607
def processResponse(self, arg, replytype, **kw):
        
        if self.debug:
            log.msg('--->PROCESS REQUEST\n%s' %arg, debug=1)

        for h in self.handlers:
            arg.addCallback(h.processResponse, **kw)
            
        arg.addCallback(self.parseResponse, replytype)
1188908
public function beforeSend()
    {
        $this->client->beforeSend($this);

        $event = new RequestEvent();
        $event->request = $this;
        $this->trigger(self::EVENT_BEFORE_SEND, $event);
    }