Process result of real request performed via transport extension.
434474
def process_request_result(self, prepare_response_func=None):
        

        now = datetime.utcnow()
        # TODO: move into separate method
        if self.config['debug_post']:
            post = self.config['post'] or self.config['multipart_post']
            if isinstance(post, dict):
                post = list(post.items())
            if post:
                if isinstance(post, six.string_types):
                    post = make_str(post[:self.config['debug_post_limit']],
                                    errors='ignore') + b'...'
                else:
                    items = normalize_http_values(
                        post, charset=self.config['charset'])
                    new_items = []
                    for key, value in items:
                        if len(value) > self.config['debug_post_limit']:
                            value = value[
                                :self.config['debug_post_limit']] + b'...'
                        else:
                            value = value
                        new_items.append((key, value))
                    post = '\n'.join('%-25s: %s' % x for x in new_items)
            if post:
                logger_network.debug('[%02d] POST request:\n%s\n',
                                     self.request_counter, post)

        # It's important to delete old POST data after request is performed.
        # If POST data is not cleared then next request will try to use them
        # again!
        self.reset_temporary_options()

        if prepare_response_func:
            self.doc = prepare_response_func(self.transport, self)
        else:
            self.doc = self.transport.prepare_response(self)

        self.doc.process_grab(self)

        if self.config['reuse_cookies']:
            self.cookies.update(self.doc.cookies)

        self.doc.timestamp = now

        self.config['charset'] = self.doc.charset

        if self.config['log_file']:
            with open(self.config['log_file'], 'wb') as out:
                out.write(self.doc.body)

        if self.config['cookiefile']:
            self.cookies.save_to_file(self.config['cookiefile'])

        if self.config['reuse_referer']:
            self.config['referer'] = self.doc.url

        self.copy_request_data()

        # Should be called after `copy_request_data`
        if self.config['log_dir']:
            self.save_dumps()

        return self.doc
1111783
def _process_results():
    """"""
    async = get_current_async()
    callbacks = async.get_callbacks()

    if not isinstance(async.result.payload, AsyncException):
        callback = callbacks.get('success')
    else:
        callback = callbacks.get('error')

        if not callback:
            raise async.result.payload.exception, None, \
                async.result.payload.traceback[2]

    return _execute_callback(async, callback)
905445
function(_cache,_result){
            var _data = {
                data:_result
            };
            // parse ext headers
            var _keys = _cache.result.headers;
            if (!!_keys){
                _data.headers = _cache.req._$header(_keys);
            }
            // TODO parse other ext data
            return _data;
        }
448615
function handleExecResult(m, workerIdx) {
	var job = jobs[m.context.jobID];
		
	job.cb(m.err, m.result);

	// Worker is finished.
	workerJobCount[workerIdx]--;
	dispatchWorkItems();
}
817945
def _handle_api_result(result: Optional[Dict[str, Any]]) -> Any:
    
    if isinstance(result, dict):
        if result.get('status') == 'failed':
            raise ActionFailed(retcode=result.get('retcode'))
        return result.get('data')
240855
def _handle_result(self):
        
        result = self.inbox.get()
        if result.success:
            if self._verbosity >= VERB_PROGRESS:
                sys.stderr.write("\nuploaded chunk {} \n".format(result.index))
            self.results.append((result.index, result.md5))
            self._pending_chunks -= 1
        else:
            raise result.traceback
789455
def _process_request(self, request, client_address):
        """"""
        try:
            self.finish_request(request, client_address)
        except Exception:
            self.handle_error(request, client_address)
        finally:
            self.shutdown_request(request)
709066
def _wrap_result(self, response):
        
        if isinstance(response, int):
            response = self._wrap_response(response)

        return HandlerResult(
            status=HandlerStatus.RETURN,
            message_out=self._response_proto(**response),
            message_type=self._response_type)
894502
def process_request(self, req, resp):
        

        key = req.env['REMOTE_PORT'] + req.env['REMOTE_ADDR']
        val = self.cache.get(key, 0)

        if val == self.count:
            abort(exceptions.TooManyRequests(headers=self._error_headers))
        else:
            self.cache[key] = val + 1
836052
def handle_pubrec(self):
        """"""
        self.logger.info("PUBREC received")

        ret, mid = self.in_packet.read_uint16()

        if ret != NC.ERR_SUCCESS:
            return ret

        evt = event.EventPubrec(mid)
        self.push_event(evt)

        return NC.ERR_SUCCESS
1132631
def process_request(self, request_object):
        """"""

        resource = request_object.entity_cls.create(**request_object.data)
        return ResponseSuccessCreated(resource)
902885
def pre_request(self, response, exc=None):
        
        if response.request.method == 'CONNECT':
            self.start_response(
                '200 Connection established',
                [('content-length', '0')]
            )
            # send empty byte so that headers are sent
            self.future.set_result([b''])
            # proxy - server connection
            upstream = response.connection
            # client - proxy connection
            dostream = self.connection
            # Upgrade downstream connection
            dostream.upgrade(partial(StreamTunnel.create, upstream))
            #
            # upstream upgrade
            upstream.upgrade(partial(StreamTunnel.create, dostream))
            response.fire_event('post_request')
            # abort the event
            raise AbortEvent
        else:
            response.event('data_processed').bind(self.data_processed)
            response.event('post_request').bind(self.post_request)
677990
protected void processResult(RO result) {
        for (ResultHandler<RO> resultHandler : resultHandlers) {
            resultHandler.handleResult(result);
        }
    }
1030120
def process_request(self, request_object):
        """"""

        identifier = request_object.identifier

        # Look for the object by its ID and return it
        resource = request_object.entity_cls.get(identifier)
        return ResponseSuccess(Status.SUCCESS, resource)
76007
function handle_checkUrl(result)
			{
				maybeCallback(thisObj.handlers.link)(result, input.data.customData);
				
				// Auto-starts next queue item, if any
				// If not, fires "end"
				done();
			}
481195
def retrieve_extension(self, name, **kw):
        """"""

        response = self.request(E.retrieveExtensionRequest(
            E.name(name),
            E.withDescription(int(kw.get('with_description', 0))),
            E.withPrice(int(kw.get('with_price', 0))),
            E.withUsageCount(int(kw.get('with_usage_count', 0))),
        ))

        return response.as_model(Extension)
1103114
def request(operation, version = nil, params = {})
      response = open(request_url(operation, version, params), @http_opts) do |f|
        @raw_response = f.read
        JSON.parse(@raw_response)
      end
      unless response['Header']['Status'] == 'Success'
        raise ApiError.new(response['Header']['Status'], response['Header']['StatusMsg']) 
      end
      extract_result(response, operation)
    end