when the want to speed up the response
490881
public void closeResponseOutput(boolean releaseChannel) {
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)){
            logger.entering(CLASS_NAME, "closeResponseOutput","["+this+"]");
            logger.logp (Level.FINE, CLASS_NAME, "closeResponseOutput", "releaseChannel->"+releaseChannel+", writerClosed->"+writerClosed);
        }
        // if user hasn't closed stream or writer on a forward, close it for them
        if (writerClosed == false) {
            // PK63328 starts - last flush to OutputStream

            boolean isArdEnabled = false;
            if (WebContainer.getWebContainer().getWebContainerConfig().isArdEnabled()) {
                if (((WebAppDispatcherContext) _connContext.getRequest().getWebAppDispatcherContext()).getWebApp().getWebAppConfig().isArdEnabled()) {
                    isArdEnabled = true;
                    //PK89810 Start                     
                    WebContainerRequestState reqState = WebContainerRequestState.getInstance(true);
                    reqState.setAttribute("com.ibm.ws.webcontainer.appIsArdEnabled", true);                     
                    //PK89810 End
                }
            }

            //The goal of this logic is to close the response, release the channel, and send as Content-Length instead of chunked.
            //Previously we tried to just call close after calling setLastBuffer, but that doesn't work because if there is anything
            //already in the Channel's byte buffer queue you don't want to indicate its the last buffer before you're really ready and truncate the response.
            //Therefore, we must call flush with flushMode false so we can get all the data to the channel without it trying to
            //send everything out to the client before its really the last buffer. We gate the checks with if (!isArdEnabled) so
            //we don't indicate that the response is finished until we exit back out through the stack. Otherwise, it could try to close
            //the connection and invalidate the request before we're even out of the Servlet container/servlet call stack

            //All of this next if block is totally new since PK63328
            if (!isArdEnabled){
                _response.setFlushMode(false);
                _response.setIsClosing(true);
                try{
                    if (_gotOutputStream == true){
                        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)){
                            logger.logp (Level.FINE, CLASS_NAME, "closeResponseOutput", "flush output stream");
                        }
                        if ( !(_bufferedOut instanceof WCOutputStream) || !((WCOutputStream)_bufferedOut).isClosed())
                            _bufferedOut.flush();
                    }
                    else if (_gotWriter == true){
                        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)){
                            logger.logp (Level.FINE, CLASS_NAME, "closeResponseOutput", "flush writer");
                        }
                        _pwriter.flush();
                    }
                }
                catch (Throwable th){
                    if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.SEVERE)) {
                        logger.logp (Level.SEVERE, CLASS_NAME, "closeResponseOutput", "Error.while.flushing.last.response");
                    }
                }

                _response.setFlushMode(true);
            }

            //This code was always here minus the check for isArdEnabled and setLastBuffer(true)
            //so we should continue calling close even for ard
            //
            try {
                if (_gotOutputStream == true) {
                    if (!isArdEnabled){
                        //PK89810
                        // PM18543 - Add test for WCCustomProperties.COMPLETE_DATA_RESPONSE
                        if (WCCustomProperties.COMPLETE_DATA_RESPONSE && !WCCustomProperties.FINISH_RESPONSE_ON_CLOSE){
                            if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)){
                                logger.logp (Level.FINE, CLASS_NAME, "closeResponseOutput", "setLastBuffer to true ");
                            }
                            _response.setLastBuffer(true); //PK89810,  setLastBuffer in  finish of BufferedWriter if CP is set
                        }
                    }

                    _bufferedOut.close();
                    _rawOut.close();
                }
                else if (_gotWriter == true) {
                    if (!isArdEnabled){
                        //PK89810
                        // PM18543 - Add test for WCCustomProperties.COMPLETE_DATA_RESPONSE
                        if (WCCustomProperties.COMPLETE_DATA_RESPONSE && !WCCustomProperties.FINISH_RESPONSE_ON_CLOSE){
                            if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)){
                                logger.logp (Level.FINE, CLASS_NAME, "closeResponseOutput", "setLastBuffer to true ");
                            }
                            _response.setLastBuffer(true); //PK89810 ,  setLastBuffer in finish of BufferedServletOutputStream if CP is set
                        }
                    }
                    // PK63328 ends
                    _pwriter.close();
                    _rawOut.close();
                }
// code below LIBERTY only
                if (releaseChannel)
                {
                    _response.releaseChannel();
                    WebContainerRequestState.getInstance(true).setCompleted(true);
                }
// code above LIBERTY only
            }
            catch (Throwable th) {
                logger.logp(Level.SEVERE, CLASS_NAME,"closeResponseOutput", "Error.while.closing.response.output",th);
            }
        }
        //Not sure if we should be doing this outside of writeClosed
        //This is not called by default. Only by WebServices and AsyncServlet completion
        if (releaseChannel){
            //check to avoid double release
            WebContainerRequestState reqState = WebContainerRequestState.getInstance(true);
            if (! reqState.isCompleted()) {
                _response.releaseChannel();
                if (reqState.getCurrentThreadsIExtendedRequest()==this.getRequest())
                    WebContainerRequestState.getInstance(true).setCompleted(true);
            }
        }
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)){
            logger.exiting(CLASS_NAME, "closeResponseOutput");
        }
    }
17706
function quickReply(payload, callback)
{
  if (payload.quick_reply && typeof payload.quick_reply.payload == 'string')
  {
    // TODO: Make better parse and as a library
    payload.quick_reply.payload = JSON.parse(payload.quick_reply.payload);
  }

  callback(null, payload);
}
1098656
function() {
		if(!_self.waitingForResponse && _self.queue.length) {
			_self.waitingForResponse = true;
			var cmd = _self.queue.shift();

			if(_self.conn) {
				_self.conn.removeAllListeners('data');
				_self.conn.addListener('data', function(data) {
					Debug.log('response:');
					Debug.log(data);
					cmd.responseHandler.call(cmd, data);
				});
			}
			Debug.log('request:');
			Debug.log(cmd.command());
			process.nextTick(function() {
				_self.conn.write(cmd.command());
			});
		}
	}
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)
826755
def process_response(self, request, response):
        
        if self._is_enabled():
            log_prefix = self._log_prefix(u"After", request)
            new_memory_data = self._memory_data(log_prefix)

            log_prefix = self._log_prefix(u"Diff", request)
            cached_memory_data_response = self._cache.get_cached_response(self.memory_data_key)
            old_memory_data = cached_memory_data_response.get_value_or_default(None)
            self._log_diff_memory_data(log_prefix, new_memory_data, old_memory_data)
        return response
277509
def handleResponseEnd(self):
        
        try:
            if not self._finished:
                reactor.callInThread(
                    self.resource.cacheContent,
                    self.father,
                    self._response,
                    self.buffer
                )
            proxy.ProxyClient.handleResponseEnd(self)
        except RuntimeError:
            # because we don't care if the user hits
            # refresh before the request is done
            pass
83430
private byte[] waitForResponse(final IndividualAddress from, final int minAsduLen, final int maxAsduLen,
		final long timeout, final Optional<List<IndividualAddress>> responders)
			throws KNXInvalidResponseException, KNXTimeoutException, InterruptedException
	{
		long remaining = timeout;
		final long end = System.currentTimeMillis() + remaining;
		synchronized (indications) {
			while (remaining > 0) {
				while (indications.size() > 0) {
					final CEMI frame = indications.remove().getFrame();
					final byte[] apdu = frame.getPayload();
					if (svcResponse != DataUnitBuilder.getAPDUService(apdu))
						continue;
					// broadcasts set parameter from to null; we then accept every sender address
					if (from != null) {
						if (!((CEMILData) frame).getSource().equals(from))
							continue;
					}
					if (apdu.length < minAsduLen + 2 || apdu.length > maxAsduLen + 2) {
						final String s = "invalid ASDU response length " + (apdu.length - 2)
								+ " bytes, expected " + minAsduLen + " to " + maxAsduLen;
						logger.error("received response with " + s);
						throw new KNXInvalidResponseException(s);
					}
					if (svcResponse == IND_ADDR_RESPONSE || svcResponse == IND_ADDR_SN_RESPONSE)
						return ((CEMILData) frame).getSource().toByteArray();
					indications.clear();
					responders.ifPresent((l) -> l.add(((CEMILData) frame).getSource()));
					return apdu;
				}
				indications.wait(remaining);
				remaining = end - System.currentTimeMillis();
			}
		}
		throw new KNXTimeoutException("timeout occurred while waiting for data response");
	}
351449
def QueueResponse(self, response, timestamp=None):
    """"""
    if timestamp is None:
      timestamp = self.frozen_timestamp
    self.response_queue.append((response, timestamp))
653202
function desiredResponse (context) {
  const callback = context.task.callbackManager.callbacks[context.executionName]
  return callback ? callback.eventName : COMPLETE
}
633893
void awaitResponses() {
        try {
            boolean finishedNicely = responseFinished.await(WAIT_TIMEOUT_MILISECONDS, TimeUnit.MILLISECONDS);
            if (!finishedNicely) {
                throw new WarpSynchronizationException(WarpContextStore.get());
            }
        } catch (InterruptedException e) {
        }
    }
101480
def start_response(self, status = 200, headers = [], clearheaders = True, disabletransferencoding = False):
        ""
        if self._sendHeaders:
            raise HttpProtocolException('Cannot modify response, headers already sent')
        self.status = status
        self.disabledeflate = disabletransferencoding
        if clearheaders:
            self.sent_headers = headers[:]
        else:
            self.sent_headers.extend(headers)
696435
def update_response_object(self, service_id, version_number, name_key, **kwargs):
		""""""
		body = self._formdata(kwargs, FastlyResponseObject.FIELDS)
		content = self._fetch("/service/%s/version/%d/response_object/%s" % (service_id, version_number, name_key), method="PUT", body=body)
		return FastlyResponseObject(self, content)
361525
def delay_or_eager(self, *args, **kwargs):
        
        return self.async_or_eager(args=args, kwargs=kwargs)
570101
public void pingLoop() {
        if ( ! isStopped() ) {
            Log.Info(this, "----------- START MULTI RESPONSE REQUEST ------------");
            mediator.askSubscribers(self(), "defaultTopic", "Hello from " + myName,
                (reply, error) -> {
                    if (Actors.isComplete(error)) {
                        Log.Info(this,"----------- ALL RESULTS RECEIVED ------------");
                        delayed(5000, () -> pingLoop());
                    } else {
                        Log.Info(this,"=>" + reply);
                    }
                });
        }
    }
1135478
def _add_response(self, response, weight=1):
        
        # If no response with this priority level has been defined yet, create a new list
        if response.priority not in self._responses:
            self._responses[response.priority] = [(response, weight)]
            return

        # Otherwise, add this trigger to an existing priority list
        self._responses[response.priority].append((response, weight))
240975
private void processResponse(Response response) {
        // at this point a server response should contain a secure JSON with challenges
        JSONObject jsonResponse = Utils.extractSecureJson(response);
        JSONObject jsonChallenges = (jsonResponse == null) ? null : jsonResponse.optJSONObject(CHALLENGES_VALUE_NAME);

        if (jsonChallenges != null) {
            startHandleChallenges(jsonChallenges, response);
        } else {
            listener.onSuccess(response);
        }
    }
1242726
def _custom_response_edit(self, method, url, headers, body, response):
        
        if self.get_implementation().is_mock():
            delay = self.get_setting("MOCKDATA_DELAY", 0.0)
            time.sleep(delay)
            self._edit_mock_response(method, url, headers, body, response)