Flushes buffered packets
@return void
192012
public function flush()
    {
        if ($this->pollMode === null) { // first polling request is not there yet
            return;
        }
        if ($this->flushing) {
            return;
        }
        $bsize = sizeof($this->buffer);
        $fbsize = sizeof($this->framesBuffer);
        if ($bsize === 0 && $fbsize === 0) {
            return;
        }
        $this->flushing = true;
        if (in_array('one-by-one', $this->pollMode)) {
            $b = array_slice($this->buffer, 0, 1);
            $bsize = sizeof($b);
        } else {
            $b = $this->buffer;
        }
        if ($fbsize > 0) {
            if (!in_array('one-by-one', $this->pollMode) || !sizeof($b)) {
                $b[] = 'a' . $this->toJson($this->framesBuffer);
            } else {
                $fbsize = 0;
            }
        }
        $this->appInstance->publish(
            's2c:' . $this->id,
            $this->toJson($b),
            function ($redis) use ($bsize, $fbsize, $b) {
                $this->flushing = false;
                if (!$redis) {
                    return;
                }
                //D(['b' => $b, $redis->result]);
                if ($redis->result === 0) {
                    return;
                }
                $reflush = false;
                if (sizeof($this->buffer) > $bsize) {
                    $this->buffer = array_slice($this->buffer, $bsize);
                    $reflush = true;
                } else {
                    $this->buffer = [];
                }

                if (sizeof($this->framesBuffer) > $fbsize) {
                    $this->framesBuffer = array_slice($this->framesBuffer, $fbsize);
                    $reflush = true;
                } else {
                    $this->framesBuffer = [];
                }
                $this->onWrite();
                if ($reflush && in_array('stream', $this->pollMode)) {
                    $this->flush();
                }
            }
        );
    }
1124201
public function flush()
    {
        if (!self::$curlHandle) {
            register_shutdown_function(array('Thrift\\Transport\\TCurlClient', 'closeCurlHandle'));
            self::$curlHandle = curl_init();
            curl_setopt(self::$curlHandle, CURLOPT_RETURNTRANSFER, true);
            curl_setopt(self::$curlHandle, CURLOPT_BINARYTRANSFER, true);
            curl_setopt(self::$curlHandle, CURLOPT_USERAGENT, 'PHP/TCurlClient');
            curl_setopt(self::$curlHandle, CURLOPT_CUSTOMREQUEST, 'POST');
            curl_setopt(self::$curlHandle, CURLOPT_FOLLOWLOCATION, true);
            curl_setopt(self::$curlHandle, CURLOPT_MAXREDIRS, 1);
        }
        // God, PHP really has some esoteric ways of doing simple things.
        $host = $this->host_ . ($this->port_ != 80 ? ':' . $this->port_ : '');
        $fullUrl = $this->scheme_ . "://" . $host . $this->uri_;

        $headers = array();
        $defaultHeaders = array('Accept' => 'application/x-thrift',
            'Content-Type' => 'application/x-thrift',
            'Content-Length' => TStringFuncFactory::create()->strlen($this->request_));
        foreach (array_merge($defaultHeaders, $this->headers_) as $key => $value) {
            $headers[] = "$key: $value";
        }

        curl_setopt(self::$curlHandle, CURLOPT_HTTPHEADER, $headers);

        if ($this->timeout_ > 0) {
            curl_setopt(self::$curlHandle, CURLOPT_TIMEOUT, $this->timeout_);
        }
        curl_setopt(self::$curlHandle, CURLOPT_POSTFIELDS, $this->request_);
        $this->request_ = '';

        curl_setopt(self::$curlHandle, CURLOPT_URL, $fullUrl);
        $this->response_ = curl_exec(self::$curlHandle);
        $responseError = curl_error(self::$curlHandle);

        $code = curl_getinfo(self::$curlHandle, CURLINFO_HTTP_CODE);

        // Handle non 200 status code / connect failure
        if ($this->response_ === false || $code !== 200) {
            curl_close(self::$curlHandle);
            self::$curlHandle = null;
            $this->response_ = null;
            $error = 'TCurlClient: Could not connect to ' . $fullUrl;
            if ($responseError) {
                $error .= ', ' . $responseError;
            }
            if ($code) {
                $error .= ', HTTP status code: ' . $code;
            }
            throw new TTransportException($error, TTransportException::UNKNOWN);
        }
    }
707290
public static function flush() {
        if (count($_COOKIE) > 0) {
            foreach ($_COOKIE as $key => $value) {
                self::delete($key, '/');
            }
        }
    }
411968
public function flush()
  {
    // God, PHP really has some esoteric ways of doing simple things.
    $host = $this->host_.($this->port_ != 80 ? ':'.$this->port_ : '');

    $headers = array();
    $defaultHeaders = array('Host' => $host,
                            'Accept' => 'application/x-thrift',
                            'User-Agent' => 'PHP/THttpClient',
                            'Content-Type' => 'application/x-thrift',
                            'Content-Length' => TStringFuncFactory::create()->strlen($this->buf_));
    foreach (array_merge($defaultHeaders, $this->headers_) as $key => $value) {
        $headers[] = "$key: $value";
    }

    $options = array('method' => 'POST',
                     'header' => implode("\r\n", $headers),
                     'max_redirects' => 1,
                     'content' => $this->buf_);
    if ($this->timeout_ > 0) {
      $options['timeout'] = $this->timeout_;
    }
    $this->buf_ = '';

    $contextid = stream_context_create(array('http' => $options));
    $this->handle_ = @fopen($this->scheme_.'://'.$host.$this->uri_, 'r', false, $contextid);

    // Connect failed?
    if ($this->handle_ === FALSE) {
      $this->handle_ = null;
      $error = 'THttpClient: Could not connect to '.$host.$this->uri_;
      throw new TTransportException($error, TTransportException::NOT_OPEN);
    }
  }
694325
public function flush()
    {
        try {
            $this->conn->exec(self::FLUSH_SQL);
        } catch (\PDOException $e) {
            return false;
        }
        return true;
    }
1161139
public static function flush() {
		if(self::$entity_manager == null)
			self::initialize();

		return call_user_func_array(array(self::$entity_manager, "flush"), func_get_args());
	}
802887
public function flush()
    {
        $keys = $this->getCacheKeys();
        foreach ($keys as $key) {
            Cache::forget($this->makeCacheKey($key));
        }
        $this->removeKeys($keys);
    }
1221883
public function flush(): void
    {
        if (null === $this->getNodeBatchRequest) {
            return;
        }

        if (!$this->getNodeBatchRequest->has('node_refs')) {
            return;
        }

        try {
            $request = $this->getNodeBatchRequest;
            $this->getNodeBatchRequest = null;
            $this->pbjx->request($request);
        } catch (\Throwable $e) {
            $this->logger->error(
                sprintf('%s::NcrLazyLoader::flush() could not complete.', ClassUtils::getShortName($e)),
                ['exception' => $e, 'pbj' => $request->toArray()]
            );
        }
    }
830364
public function flushCache()
    {
        $adapter = $this->driver->getAdapter();

        if ($adapter instanceof CachedAdapter) {
            $adapter->getCache()->flush();
        }
    }
444346
public function flush()
    {
        $this->_result = null;
        $this->_lastResult = array();
        $this->_lastQuery = null;
        $this->_lastQueryHash = null;
    }
1002775
public function flush()
    {
        if (!$this->config["blocking"] && !empty($this->asyncBuffer)) {
            $wrote = fwrite($this->destinationHandler, $this->asyncBuffer);
            $this->asyncBuffer = substr($this->asyncBuffer, $wrote);
        }

        return empty($this->asyncBuffer);
    }
990945
public function flush() {
    if ($this->locked) return;
    while ($this->send()) {
    }
    foreach ($this->files as $file) {
      $this->output($file->getCentral());
    }
    $this->output($this->getEOF());
    $this->locked = TRUE;
    $this->outputter->flush();
  }
618410
public final void flush() {
        int totalBytes = 0;
        int amountToPoll = outgoingPackets.size();
        
        Packet packet;

        boolean shouldEncrypt = encryption != null;
        
        var queue = new ArrayDeque<byte[]>();

        while (amountToPoll-- > 0 && (packet = outgoingPackets.poll()) != null) {
            int currentBytes = totalBytes;

            boolean tooBig = (totalBytes += packet.getSize(this)) >= bufferSize;
            boolean empty = outgoingPackets.isEmpty();

            if (!tooBig || empty) {
                queue.addAll(packet.getQueue());
            }

            // If we've buffered all of the packets that we can, send them off.
            if (tooBig || empty) {
                var raw = DIRECT_BUFFER_POOL.take(empty ? totalBytes : currentBytes);
                
                byte[] input;
                
                try {
                    while ((input = queue.pollFirst()) != null) {
                        raw.put(shouldEncrypt ? encryption.doFinal(input) : input);
                    }
                } catch (Exception e) {
                    throw new IllegalStateException("An exception occurred whilst encrypting data:", e);
                }
                
                raw.flip();
                
                queue.addAll(packet.getQueue());
                
                // It is important to synchronize on the packetsToFlush here, as we don't want the callback to
                // complete before the packet is queued.
                synchronized (packetsToFlush) {
                    if (!writing.getAndSet(true)) {
                        channel.write(raw, new Tuple<>(this, raw), PACKET_HANDLER);
                    } else {
                        packetsToFlush.offerFirst(raw);
                    }
                }

                totalBytes = packet.getSize(this);
            }
        }
    }
1209648
public function flush()
    {
        Files::emptyDirectoryRecursively($this->cacheDirectory);
        if ($this->frozen === true) {
            @unlink($this->cacheDirectory . 'FrozenCache.data');
            $this->frozen = false;
        }
    }
1114325
public function flush()
    {
 		global $wpdb;

 		$cachedItems = $wpdb->get_results("
 			SELECT *
 			FROM  {$wpdb->options}
 			WHERE  option_name LIKE  '_transient_%'
 		");

 		foreach ($cachedItems as $item) {
 			$cachedKey = str_replace('_transient_', '', $item->option_name);
 			delete_transient($cachedKey);
 		}
 	}
1172875
void flushBuffer() throws IOException {
        synchronized (lock) {
            ensureOpen();
            if (nextChar == 0)
                return;
            out.write(cb, 0, nextChar);
            nextChar = 0;
        }
    }
193332
protected function flush()
    {
        $node = null;

        $this->isCode = false;

        if ($this->buffer) {
            switch ($this->state) {
            case self::STATE_TITLE:
                $data = implode("\n", $this->buffer);
                $level = $this->environment->getLevel($this->specialLetter);
                $token = $this->environment->createTitle($level);
                $node = $this->kernel->build('Nodes\TitleNode', $this->createSpan($data), $level, $token);
                break;
            case self::STATE_SEPARATOR:
                $level = $this->environment->getLevel($this->specialLetter);
                $node = $this->kernel->build('Nodes\SeparatorNode', $level);
                break;
            case self::STATE_CODE:
                $node = $this->kernel->build('Nodes\CodeNode', $this->buffer);
                break;
            case self::STATE_BLOCK:
                $node = $this->kernel->build('Nodes\QuoteNode', $this->buffer);
                $data = $node->getValue();
                $subParser = $this->getSubParser();
                $document = $subParser->parseLocal($data);
                $node->setValue($document);
                break;
            case self::STATE_LIST:
                $this->pushListLine(null, true);
                $node = $this->buffer;
                break;
            case self::STATE_TABLE:
                $node = $this->buffer;
                $node->finalize($this);
                break;
            case self::STATE_NORMAL:
                $this->isCode = $this->prepareCode();
                $node = $this->kernel->build('Nodes\ParagraphNode', $this->createSpan($this->buffer));
                break;
            }
        }

        if ($this->directive) {
            $currentDirective = $this->getCurrentDirective();
            if ($currentDirective) {
                $currentDirective->process($this, $node, $this->directive['variable'], $this->directive['data'], $this->directive['options']);
            }
            $node = null;
        }

        $this->directive = null;

        if ($node) {
            $this->document->addNode($node);
        }

        $this->init();
    }