processes entries in the queue until told to stop
174532
def run(self) -> None:
        
        while not self.cleanup:
            try:
                result, test, additional_info = self.result_queue.get(timeout=1)
            except queue.Empty:
                continue

            self.result_queue.task_done()

            if result == TestState.serialization_failure:
                test = self.tests[test]
                warnings.warn("Serialization error: {} on test {}".format(
                    additional_info, test), SerializationWarning)
                test(self)

            else:
                self.testsRun += 1

                if result == TestState.success:
                    self.addSuccess(test)
                elif result == TestState.failure:
                    self.addFailure(test, additional_info)
                elif result == TestState.error:
                    self.addError(test, additional_info)
                elif result == TestState.skipped:
                    self.addSkip(test, additional_info)
                elif result == TestState.expected_failure:
                    self.addExpectedFailure(test, additional_info)
                elif result == TestState.unexpected_success:
                    self.addUnexpectedSuccess(test)
                else:
                    raise Exception("This is not a valid test type :", result)
729494
def stop(self, wait=True):
        ''' 

        '''

        # TODO should probably close all connections and shut down all sessions here
        for context in self._applications.values():
            context.run_unload_hook()

        self._stats_job.stop()
        if self._mem_job is not None:
            self._mem_job.stop()
        self._cleanup_job.stop()
        if self._ping_job is not None:
            self._ping_job.stop()

        self._clients.clear()
356285
def wait_until_finished(self):
        """"""
        try:
            self.thread.join()
        except KeyboardInterrupt:
            self._logger.debug('Keyboard interrupt detected, stopping driver.')
            self._active = False
            self._wake_queue()
18958
protected void spoolerRun ()
    {
        while (true) {
            try {
                SoundKey key;
                synchronized (_queue) {
                    _freeSpoolers++;
                    key = _queue.get(MAX_WAIT_TIME);
                    _freeSpoolers--;

                    if (key == null || key.cmd == DIE) {
                        _spoolerCount--;
                        // if dying and there are others to kill, do so
                        if (key != null && _spoolerCount > 0) {
                            _queue.appendLoud(key);
                        }
                        return;
                    }
                }

                // process the command
                processKey(key);

            } catch (Exception e) {
                log.warning(e);
            }
        }
    }
1280163
def flush(self, queue_name):
        
        for _ in iter_queue(self.queues[queue_name]):
            self.queues[queue_name].task_done()
315918
private void processQueuedAudits(boolean interruptable) {
        QueuedAudit audit;
        try {
            while (!(_auditService.isShutdown() && interruptable) && ((audit = _auditQueue.poll()) != null)) {
                boolean written = false;
                while (!written) {
                    AuditOutput auditOutput = getAuditOutputForTime(audit.time);
                    written = auditOutput.writeAudit(audit);
                }
            }
        } catch (Exception e) {
            _log.error("Processing of queued audits failed", e);
        }
    }
43854
function (end, queue) {
            var self = this;
            util.each(self, function (elem) {
                Anim.pause(elem, queue);
            });
            return self;
        }
1162838
public void process( FastQueue<AssociatedIndex> matches , int numSource , int numDestination ) {

		if( checkSource ) {
			if( checkDestination ) {
				processSource(matches, numSource, firstPass);
				processDestination(firstPass,numDestination,pruned);
			} else {
				processSource(matches, numSource, pruned);
			}
		} else if( checkDestination ) {
			processDestination(matches,numDestination,pruned);
		} else {
			// well this was pointless, just return the input set
			pruned = matches;
		}
	}
200168
public void queueEntry(String entryPath, InputStream inStream,
                           int maxBytes)
                           throws IOException, TarMalformatException {
        entryQueue.add(new TarEntrySupplicant(entryPath, inStream, maxBytes,
                                              '0', archive));
    }
405221
def process_events
      until @dead
        @mutex.synchronize do
          while @queue.empty?
            break if @dead
            @not_empty.wait(@mutex)
          end
          event = @queue.pop
          break unless event
          notify_listeners(event)
          event.dispatch
        end
      end
    rescue Exception => ex
      Logger.error "Error while running event: #{Logger.format_error(ex)}"
    end
1215876
def stop(self):
        '''
        
        '''
        # clear queue up to first end loop command
        while(True):
            try:
                mtd, args, name = self._queue[0]
            except IndexError:
                break
            if(mtd == self._engine.endLoop):
                break
            self._queue.pop(0)
        self._driver.stop()
186037
def stop_process(self):
        
        self._process.terminate()
        if not self._process.waitForFinished(100):
            self._process.kill()
1149412
private void stop() {
        finish(inputThread);

        try {
            err.flush();
        } catch (IOException e) {
            // ignore
        }
        try {
            out.flush();
        } catch (IOException e) {
            // ignore
        }
        finish(outputThread);
        finish(errorThread);
    }
993399
void fireEntryLeave(AsteriskQueueEntryImpl entry)
    {
        synchronized (listeners)
        {
            for (AsteriskQueueListener listener : listeners)
            {
                try
                {
                    listener.onEntryLeave(entry);
                }
                catch (Exception e)
                {
                    logger.warn("Exception in onEntryLeave()", e);
                }
            }
        }
    }
748043
function queue(runner) {
    if (running < tasks) {
      ++running;
      runner(release);
    } else {
      pending.push(runner);
    }
  }
474976
async def trigger(self, event, kwargs):
        
        await self._queue.put((event, kwargs))
        self._resume_processing.set()
500003
function flushQueueIfAvailable()
    {
        if (!isLogAvailable())
            return;

        clearInterval(WebInspector.log.interval);
        delete WebInspector.log.interval;

        flushQueue();
    }