Flush the queue. This method should only be called from the event processing queue
        :param sync: if true, flushes the queue synchronously in the current thread
        :return: None
351893
def _flush(self, buffer):
        
        if not self.state.should_try():
            logger.error("dropping flushed data due to transport failure back-off")
        else:
            fileobj = buffer.fileobj  # get a reference to the fileobj before closing the gzip file
            buffer.close()

            # StringIO on Python 2 does not have getbuffer, so we need to fall back to getvalue
            data = fileobj.getbuffer() if hasattr(fileobj, "getbuffer") else fileobj.getvalue()
            try:
                self.send(data)
                self.handle_transport_success()
            except Exception as e:
                self.handle_transport_fail(e)
726895
def flush(self, safe=None):
		''' '''
		result = None
		for index, op in enumerate(self.queue):
			try:
				result = op.execute()
			except:
				self.clear_queue()
				self.clear_cache()
				raise
		self.clear_queue()
		return result
227906
def flush(self, queue_name):
        
        for name in (queue_name, dq_name(queue_name)):
            self.do_purge(name)
1280163
def flush(self, queue_name):
        
        for _ in iter_queue(self.queues[queue_name]):
            self.queues[queue_name].task_done()
939367
@Override
  protected void flushAndSync(boolean durable) throws IOException {
    if (outputStream == null) {
      throw new IOException("Trying to use aborted output stream!");
    }
    if (doubleBuf.isFlushed()) {
      return;
    }
    // Under the covers, this invokes a method that does not return until
    // we have successfully persisted the buffer to a quorum of bookies.
    doubleBuf.flushTo(outputStream);
  }
1197564
def __flush(self):
        """"""
        if self.__args is None or self.__disconnecting:
            return False
        #self.emit(self.signal, *self.args)
        self.__sigDelayed.emit(self.__args)
        self.__args = None
        self.__timer.stop()
        self.__lastFlushTime = time.time()
        return True
715996
public void flush(final long targetCounter) throws IOException {
    if (targetCounter <= mFlushCounter.get()) {
      return;
    }
    // Using reentrant lock, since it seems to result in higher throughput than using 'synchronized'
    mFlushLock.lock();
    try {
      long startTime = System.nanoTime();
      long flushCounter = mFlushCounter.get();
      if (targetCounter <= flushCounter) {
        // The specified counter is already flushed, so just return.
        return;
      }
      long writeCounter = mWriteCounter.get();
      while (targetCounter > writeCounter) {
        for (;;) {
          // Get, but do not remove, the head entry.
          JournalEntry entry = mQueue.peek();
          if (entry == null) {
            // No more entries in the queue. Break out of the infinite for-loop.
            break;
          }
          mJournalWriter.write(entry);
          // Remove the head entry, after the entry was successfully written.
          mQueue.poll();
          writeCounter = mWriteCounter.incrementAndGet();

          if (writeCounter >= targetCounter) {
            if ((System.nanoTime() - startTime) >= mFlushBatchTimeNs) {
              // This thread has been writing to the journal for enough time. Break out of the
              // infinite for-loop.
              break;
            }
          }
        }
      }
      mJournalWriter.flush();
      mFlushCounter.set(writeCounter);
    } finally {
      mFlushLock.unlock();
    }
  }
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);
    }
  }
482093
def flush(self):
        
        self.queue(None, None, flush=True)
        if not self._flushed.wait(timeout=self._max_flush_time):
            raise ValueError("flush timed out")
1110436
def flush(flush = Zlib::SYNC_FLUSH)
      run '', flush unless flush == Zlib::NO_FLUSH

      detatch_output
    end
1047748
def _flush(self):
        
        for consumer in self.consumers:
            if not getattr(consumer, "closed", False):
                consumer.flush()
223753
def flush_buffer
      # note we must discard cancelled timer or else we never create a new timer and stay cancelled.
      if @timer
        @timer.cancel
        @timer = nil
      end

      to_send = nil
      @mutex.synchronize do
        unless @buffer.empty?
          to_send = @buffer
          @buffer = ''
        end
      end

      if to_send
        internal_send_audit(:kind => :output, :text => to_send, :category => EventCategories::NONE)
      end
    end
1332946
def flush(self):
        
        if self.buffer is None:
            return
        data = self.buffer
        self.buffer = []
        for x in self.dests:
            yield from x.enqueue_task(self, *data)
950452
def _flush(self):
        
        if not self.enabled:
            return
        try:
            try:
                self.lock.acquire()
                self.flush()
            except Exception:
                self.log.error(traceback.format_exc())
        finally:
            if self.lock.locked():
                self.lock.release()
118787
def __flush_eventqueue(self):
        """"""
        while self.eventqueue:
            past_event = self.eventqueue.pop(0)
            self.postprocess_keyevent(past_event)
1199345
public synchronized boolean flush() {
		if (!validState) {
			throw new InvalidStateException();
		}
		try {
			flushBuffer();
			return true;
		} catch (Exception e) {
			log.error("Exception in flush()", e);
		}
		return false;
	}
124397
def flush(self):
        """"""
        Queue.flush(self)
        Event.delete(self)
        Crawl.flush(self)