This function is triggered early in the request if the "flush" query
parameter has been set. Each class that implements Flushable implements
this function which looks after it's own specific flushing functionality.

@see FlushMiddleware
346078
public static function flush()
    {
        /** @var static $self */
        $self = singleton(static::class);

        $self->getCache()->clear();

        if ($self->config()->get('regenerate_on_flush')) {
            $self->generateAllTabs();
        }
    }
1059051
public void flush()
  {
    int level = getLevel().intValue();
    
    for (int i = 0; i < _handlers.length; i++) {
      Handler handler = _handlers[i];

      if (level <= handler.getLevel().intValue())
        handler.flush();
    }
  }
850569
public function flush() {
		$specRawer = new SpecRawer($this->attributes);
		$specRawer->rawTypes($this->eiTypeExtractions, $this->customTypeExtractions);
		$specRawer->rawEiMasks($this->eiTypeExtensionExtractionGroups);
		$specRawer->rawEiModificatorExtractionGroups($this->eiModificatorExtractionGroups);
		$specRawer->rawLaunchPads($this->launchPadExtractions);
		
		$this->configSource->writeArray($this->attributes->toArray());
	}
295207
public function flush()
	{
		foreach ($this->stacks['serves'] as $key => $val)
		{
			if (array_key_exists($key, $this->stacks['cooks']))
			{
				$callback = $this->stacks['cooks'][$key];

				if ($callback instanceof Closure)
				{
					$callback($this);
				}
			}
		}
	}
724275
@Override
  public void flush() {
    try {
      out.flush();
    }
    catch(Exception ex) {
      reportError(null, ex, ErrorManager.FLUSH_FAILURE);
    }
    try {
      err.flush();
    }
    catch(Exception ex) {
      reportError(null, ex, ErrorManager.FLUSH_FAILURE);
    }
  }
496032
@Override
    public boolean flush()
    {
        //  If there are no un-flushed items, do nothing.
        if (w == f) {
            return true;
        }

        //  Try to set 'c' to 'f'.
        if (!c.compareAndSet(w, f)) {
            //  Compare-and-swap was unsuccessful because 'c' is NULL.
            //  This means that the reader is asleep. Therefore we don't
            //  care about thread-safeness and update c in non-atomic
            //  manner. We'll return false to let the caller know
            //  that reader is sleeping.
            c.set(f);
            w = f;
            return false;
        }

        //  Reader is alive. Nothing special to do now. Just move
        //  the 'first un-flushed item' pointer to 'f'.
        w = f;
        return true;
    }
86480
protected function flushIfNeeded() {
        if (!$this->_enabled) {
            return;
        }

        $now = $this->_util->nowMicros();
        $delta = $now - $this->_lastFlushMicros;

        // Set a bound on maximum flush frequency
        if ($delta < $this->_minFlushPeriodMicros) {
            return;
        }

        // Set a bound of minimum flush frequency
        if ($delta > $this->_maxFlushPeriodMicros) {
            $this->flush();
            return;
        }

        // Look for a trigger that a flush is warranted
        if (count($this->_logRecords) >= $this->_options["max_log_records"]) {
            $this->flush();
            return;
        }
        if (count($this->_spanRecords) >= $this->_options["max_span_records"]) {
            $this->flush();
            return;
        }
    }
734326
@Override
    @FFDCIgnore({ IOException.class })
    public void flushHeaders() throws IOException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "flushHeaders: committed=" + this.isc.getResponse().isCommitted());
        }
        validate();
        this.ignoreFlush = false;
        if (!this.isc.getResponse().isCommitted()) {
            this.isc.getResponse().setCommitted();
        } else {
            // response headers already committed (written)
            return;
        }
        try {
            this.isc.sendResponseHeaders();
        } catch (MessageSentException mse) {
            FFDCFilter.processException(mse, getClass().getName(),
                                        "flushHeaders", new Object[] { this, this.isc });
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                Tr.event(tc, "Invalid state, message-sent-exception received; " + this.isc);
            }
            this.error = new IOException("Invalid state");
            throw this.error;
        } catch (IOException ioe) {
            // no FFDC required
            this.error = ioe;
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Received exception during write: " + ioe);
            }
            throw ioe;
        }
    }
815461
def flush(base = nil)
    debug { 'flush ' << base.to_s }

    @sync.synchronize do

      if @flush_delay
        next_flush = @last_flush + @flush_delay

        if next_flush > Time.now
          flush_at(next_flush, base)
        else
          flush_now(base)
          @last_flush = Time.now
        end

      else
        flush_now(base)
      end
    end
  end
408449
public void flush()
  {
    if (!enabled)
    {
      return;
    }
    if (!queue.isEmpty())
    {
      // start a new thread to upload without blocking the current thread
      Runnable runUpload = new TelemetryUploader(this, exportQueueToString());
      uploader.execute(runUpload);
    }
  }
1078513
public boolean flushQueuePointOutputHandler()
    throws SIResourceException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(
        tc,
        "flushQueuePointOutputHandler");

    boolean done = true;

    for(Iterator nextHandler = _queuePointOutputHandlers.values().iterator();
        nextHandler.hasNext();)
    {
      Object handlerQ = nextHandler.next();
      // Try and drive flush on every output handler.
      // Note that we'll try and drive every output handler
      // even if an earlier output handler required a deferred
      // delete.
      if (handlerQ instanceof PtoPOutputHandler)
        done &= ((PtoPOutputHandler) handlerQ).flushAllForDelete();
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "flushQueuePointOutputHandler", new Boolean(done));
    return done;
  }
863967
private function flush()
    {
        foreach ($this->queue as $item) {
            $this->delegate->writeItem($item);
        }

        if ($this->delegate instanceof FlushableWriter) {
            $this->delegate->flush();
        }
    }
287510
protected function flushDeletes()
    {
        if ( ! $this->deleteTarget) {
            return;
        }

        foreach ($this->queuedForDelete as $variant) {
            $this->handler->deleteVariant($this->deleteTarget, $variant);
        }

        $this->queuedForDelete = [];
    }
23338
def flush(self):
        
        if self._requests_middleware:
            self._requests_middleware.flush()

        if self._trace_log_handler:
            self._trace_log_handler.flush()

        if self._exception_telemetry_client:
            self._exception_telemetry_client.flush()
901089
def _before_flush_handler(session, _flush_context, _instances):
    """"""
    dialect = get_dialect(session)
    for row in session.dirty:
        if isinstance(row, SavageModelMixin) and is_modified(row, dialect):
            # Update row version_id
            row.update_version_id()
304169
public void flush(IoSession session) {
        try {
            internalFlush(session.getFilterChain().getNextFilter(this),
                    session, buffersMap.get(session));
        } catch (Throwable e) {
            session.getFilterChain().fireExceptionCaught(e);
        }
    }
1217717
private void flushUpdateQueue() {
        LOG.debug("Run flushUpdateQueue.");

        final int size = queue.size();
        if (size <= 0) {
            return;
        }

        LOG.debug("{} events in flushUpdateQueue.", size);

        final Set<TargetPoll> events = Sets.newHashSetWithExpectedSize(queue.size());
        final int drained = queue.drainTo(events);

        if (drained <= 0) {
            return;
        }

        try {
            events.stream().collect(Collectors.groupingBy(TargetPoll::getTenant)).forEach((tenant, polls) -> {
                final TransactionCallback<Void> createTransaction = status -> updateLastTargetQueries(tenant, polls);
                tenantAware.runAsTenant(tenant,
                        () -> DeploymentHelper.runInNewTransaction(txManager, "flushUpdateQueue", createTransaction));
            });
        } catch (final RuntimeException ex) {
            LOG.error("Failed to persist UpdateQueue content.", ex);
            return;
        }

        LOG.debug("{} events persisted.", drained);
    }